嗨我刚从Keyframes换成了Cycle2(
http://jquery.malsup.com/cycle2/)作为幻灯片放映图片的方式,我交换到了cycle2,因为我相信这可以让我制作图片链接,我只需要一个图片链接而不是所有这些链接当幻灯片显示到幻灯片时,链接处于活动状态,
<img src="/images/promo1.jpg"> <img src="/images/promo2.jpg"> <img src="/images/promo3.jpg"> <img src="/images/promo4.jpg">
这很好的幻灯片完美,很快我尝试
<a href="http://www.google.co.uk"> <img src="images/promo2.jpg"></a>
在其中一个图像上,它将其从幻灯片显示中拉出来并将其显示在其下方作为其自己的图像.
任何帮助赞赏
谢谢
解决方法
From the Cycle2 FAQ
I want to use slides that are not images. How do I tell Cycle2 what my slides are?
Use the data-cycle-slides attribute to provide a jQuery selector which
identifies the elements within the container that are slides. For
example,if your slideshow is a ul with li slides you would set the
attribute like 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>
在您的情况下,您可能需要以下内容:
<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 is a 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 is a non-image slide</h2></a></li> </ul>