javascript - Cycle2 make images links -
hi ive swapped keyframes cycle2 (http://jquery.malsup.com/cycle2/) way of slideshowing images , swapped cycle2 believed allow me make images links , need 1 of images link not of them when slideshow gets slide link active ,
<img src="/images/promo1.jpg"> <img src="/images/promo2.jpg"> <img src="/images/promo3.jpg"> <img src="/images/promo4.jpg"> this works fine slideshows perfect, @ try
<a href="http://www.google.co.uk"> <img src="images/promo2.jpg"></a> on 1 of images , knocks out of slideshow , displays underneath own image.
any appreciated
thanks
i want use slides not images. how tell cycle2 slides are?
use data-cycle-slides attribute provide jquery selector identifies elements within container slides. example, if slideshow ul li slides set attribute this: data-cycle-slides="li"
<ul class="cycle-slideshow" data-cycle-slides="li"> <li><img src="path/to/some/image1.jpg"></li> <li><img src="path/to/some/image2.jpg"></li> <li><img src="path/to/some/image3.jpg"></li> </ul> in case, need like:
<ul class="cycle-slideshow" data-cycle-slides="li" data-cycle-fx="scrollhorz"> <li><a href="http://www.example.com"><img src="http://placehold.it/350x150"/></a></li> <li><a href="http://www.example.com"><h2>this non-image slide</h2></a></li> <li><a href="http://www.example.com"><img src="http://placehold.it/350x150"/></a></li> <li><a href="http://www.example.com"><h2>this non-image slide</h2></a></li> </ul>
Comments
Post a Comment