Jquery Cycle 与拇指寻呼机问题
我正在尝试使用 jquery 循环插件创建幻灯片。我试图拥有它,以便从主图像自动生成幻灯片放映的拇指。我还试图能够显示链接到其他部分的图像和一些不链接到其他部分的图像。到目前为止,当我添加主图像的链接时,拇指会断裂。这是我的代码:
<script type="text/javascript">
$(function() {
$('#ss').after('<ul id="nav">').cycle({
fx: 'fade',
speed: '2000',
pager: '#nav',
pause: 1,
// callback fn that creates a thumbnail to use as pager anchor
pagerAnchorBuilder: function(idx, slide) {
return '<li><a href="#"><img src="' + slide.a + '" width="50" height="50" /></a></li>';
}
});
});
</script>
</head>
<body>
<div id="ss" >
<a href="#"><img src="img1.jpg" /></a>
<a href="#"><img src="img2.jpg" /></a>
<a href="#"><img src="img3.jpg" /></a>
<a href="#"><img src="img4.jpg" /></a>
</div>
</body>
</html>
I'm trying to create a slideshow with the jquery cycle plugin. I'm trying to have it so that thumbs for the slide show are auto generated from the main images. I am also trying to have the ability to show both images that link out to other sections, and some that do not. So far, the thumbs break when I add a link to a main image. here is my code:
<script type="text/javascript">
$(function() {
$('#ss').after('<ul id="nav">').cycle({
fx: 'fade',
speed: '2000',
pager: '#nav',
pause: 1,
// callback fn that creates a thumbnail to use as pager anchor
pagerAnchorBuilder: function(idx, slide) {
return '<li><a href="#"><img src="' + slide.a + '" width="50" height="50" /></a></li>';
}
});
});
</script>
</head>
<body>
<div id="ss" >
<a href="#"><img src="img1.jpg" /></a>
<a href="#"><img src="img2.jpg" /></a>
<a href="#"><img src="img3.jpg" /></a>
<a href="#"><img src="img4.jpg" /></a>
</div>
</body>
</html>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想你正在寻找这样的东西?
带锚点的循环。另请参阅“slideExpr”
I think you are looking for something like this?
cycle with anchors. Also look into the "slideExpr"