gpt4 book ai didi

javascript - Cycle2制作图片链接

转载 作者:数据小太阳 更新时间:2023-10-29 05:08:12 27 4
gpt4 key购买 nike

您好,我刚刚从关键帧切换到 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>

Working Example

关于javascript - Cycle2制作图片链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16482492/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com