题
我使用Jquery的周期插件( http://malsup.com/jquery/cycle/一>)一个博客列表页面上。有多种幻灯片其做工精细,但我想每对都有自己的过去和未来。
由于这些的博客文章是困难的签名的唯一ID或类。我现在有: -
$('.article .gallery').cycle({
next: '.viewmore .left',
prev: '.viewmore .right',
timeout:0
});
我曾尝试以下,但不起作用。它给你的就是我要寻找一个更好的主意: -
$('.article .gallery').cycle({
next: $(this).next('.viewmore .left'),
prev: $(this).next('.viewmore .right'),
timeout:0
});
谁能帮助我? 由于事先。
戴夫。
解决方案
尝试是这样的:
$('.article .gallery').each(function(){
var $this = $(this);
$this.cycle({
next: $this.next('.viewmore').find('.left'),
prev: $this.next('.viewmore').find('.right')
});
});
其他提示
可以使用条目ID中的类/ IDS?
是这样的:
<span id="prev_{entry_id}">Previous</span>
<span id="next_{entry_id}">Next</span>
然后把内联的JavaScript的那部分。
不隶属于 StackOverflow