我需要在幻灯片中添加图像链接(cycle2),该链接也是使用寻呼机设置的。如何在不滑动滑块的情况下做到这一点?
<div
id="slideshow" class="cycle-slideshow"
data-cycle-manual-fx="scrollHorz"
data-cycle-pager-fx="fade"
data-cycle-manual-speed="400"
data-cycle-prev="#prev"
data-cycle-next="#next"
data-cycle-speed="600"
data-cycle-timeout="3000"
data-cycle-pager = "#pager"
data-cycle-pager-template="<a href='#'><img src='{{src}}' width=150 height=100></a>">
<img src="bear scene.jpg" alt=""/>
<img src="someimage.jpg" alt=""/>
<img src="otherimage.jpg" alt=""/>
<img src="picute.jpg" alt=""/>
<img src="somethingelse.jpg" alt=""/>
<img src="anotherpic_.jpg" alt=""/>
<img src="lastpic.jpg" alt=""/>
</div>
答案 0 :(得分:0)
如果您不想搞砸css(如果将图像包装在<a>
标签中,则需要执行此操作),您只需使用javascript onclick
事件即可打开图像链接来自这样的图像:
<img onclick="window.open('http://www.google.com', '_blank')" src="bear scene.jpg" alt=""/>
以下是一些示例:https://jsfiddle.net/2jjomuge/