您好,我试图在一页上拥有多个 jquery 循环库。ifeel 好像我的代码是正确的,但它无法正常工作......任何人都可以看看并提供帮助吗?它似乎没有找到我的 .next 和 .prev 类?
jQuery:
$('.cycle').each(function() {
var slideshow = $(this);
var next = slideshow.closest('.next');
var prev = slideshow.closest('.prev');
slideshow.cycle({
speed: 0,
timeout: 0,
next: next,
prev: prev,
});
});
html:
<div id="woodwood" class="drag">
<div class='cycle'>
<img src='invites/baldi.png' />
<img src='invites/koerfer.png' />
<img src='invites/williams.png' />
</div>
<div class="title">
Invites<br />
2010 — 2012
</div>
<div class="controls">
<a class='prev'><img src="left.gif"></a>
<a class='next'><img src="right.gif"></a>
<button>Close</button>
</div>
</div>