使用的 jQuery 代码:
$('#contentspacer').cycle({fx:'fade',speed:2500,timeout:6000,next:'.next',prev:'.prev'});
$('.pause').click(function() {$('#contentspacer').cycle('pause'); return false;});
$('.play').click(function() {$('#contentspacer').cycle('resume'); return false;});
用于“导航”的 html:
<div class="pnbtns"><a href="#" class="prev">←</a> <a href="#" class="pause">pause</a> <a href="#" class="play">play</a> <a href="#" class="next">→</a></div>
如您所见,播放和暂停按钮工作正常,并且不在末尾添加主题标签,下一个和上一个按钮仍然可以工作,但添加主题标签。
我想要做的是添加 return false;到 .prev 和 .next 按钮,不使用内联 JavaScript(我知道如何做到这一点),也不将链接留空(必须验证严格的 xhtml)。
最佳答案
这是您要找的吗?
$('.next, .prev').live('click', function(){
return false;
});
关于jquery - 添加 return true 到 jquery 循环的下一个/上一个按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1230179/