I'm working on a websites, I'm using a CMS (wordpress) it's running on php, I've a slider and I would like to make it a clickable area, meaning that if someone clicks on it it supposed to take it on another page depending on the image the slider is dispaying at the time. For example, let's say my slider (moving banner) has image A, B, C, and D, the slider changes the image every 3 seconds, A then B then 3 sec later C, then D. What I want is that when the user clicks when the slider displays image C, it takes him to page C, when he clicks on image A it takes him on page A, etc.... So far my slider doesn't do, does someone knows what I can do to solve that issue?
Here is my code for the slider:
<div id="slides">
<?php } ?>
<?php for ($i = 1; $i <= $featured_num; $i++) { ?>
<?php if ( $responsive ) { ?>
<li class="slide">
<?php } else { ?>
<div class="slide <?php if($i == 1) echo('active'); ?>">
<?php } ?>
<div class="slider_image">
<?php print_thumbnail($arr[$i]["thumb"], $arr[$i]["use_timthumb"], $arr[$i]["fulltitle"], $width, $height, ''); ?>
<div class="slider_overlay"></div>
</div>
<div class="banner">
<h2><?php echo esc_html($arr[$i]["title"]); ?></h2>
<?php echo($arr[$i]["excerpt"]); ?>
<br class="clear" />
<span><a href="<?php echo esc_url($arr[$i]["permalink"]); ?>"><?php esc_html_e('read more','SimplePress'); ?></a></span>
</div>
<?php if ( $responsive ) { ?>
</li> <!-- end .slide -->
<?php } else { ?>
</div> <!-- end .slide -->
<?php } ?>
<?php }; ?>
<?php if ( $responsive ) { ?>
</ul> <!-- end .slides -->
<?php } else { ?>
</div> <!-- end #slides -->
<?php } ?>
<span class="slider_shadow"></span>
<div id="switcher">
<?php for ($i = 1; $i <= $featured_num; $i++) { ?>
<div class="item">
<div class="wrap <?php if($i == 1) echo('active'); ?>">
<span class="image">
<?php print_thumbnail($arr[$i]["thumb_small"], $arr[$i]["use_timthumb"], $arr[$i]["fulltitle"], $width_small, $height_small, ''); ?>
<span class="slider_small_overlay"></span>
</span>
<div class="hover">
<span><?php echo esc_html($arr[$i]["fulltitle"]); ?></span>
<br class="clear" />
<?php echo($arr[$i]["excerpt_small"]); ?>
</div>
</div>
</div>
<?php }; ?>
</div><!-- #switcher -->
</div><!-- end #featured -->
This post has been edited by JackOfAllTrades: 29 September 2012 - 03:53 AM
Reason for edit:: Added code tags

New Topic/Question
Reply



MultiQuote






|