Alex Florea Alex Florea - 1 year ago 104
jQuery Question

Add link to image in the flexslider

I'm using the flexslider plugin and i wanted to know if there is an easy way (apart from changing the core of the plugin which is what i am going to do if i don't find an easy answer)
to go to link when i click on the current slide image. I set up the flexslider simply like this:

animation: 'slide'

and in the view:

<div id="slide-top" class="flexslider">
<ul class="slides">
<?php foreach ($gallery_top_slide as $image_slide): ?>
<li><img src="<?=base_url();?>assets/uploads/top_slide/<?=$image_slide['photo_url']?>" /></li>
<a href="<?=$image_slide['link_url']?>">Not need text on image</a>
<?php endforeach; ?>

How can i do this?

For ex. if i click on current image go to

Thanks in advance !

Answer Source

Try this.

            <ul class="slides">
                <?php foreach ($gallery_top_slide as $image_slide): ?>
                           <a href="<?=$image_slide['link_url']?>">
                              <img src="<?=base_url();?>assets/uploads/top_slide/<?=$image_slide['photo_url']?>" />
                <?php endforeach; ?>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download