【问题标题】:adding return true to jquery cycle's next/previous buttons将 return true 添加到 jquery 循环的下一个/上一个按钮
【发布时间】:2010-11-16 20:12:01
【问题描述】:

使用的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">&#8592;</a> <a href="#" class="pause">pause</a> <a href="#" class="play">play</a> <a href="#" class="next">&#8594;</a></div>

如您所见,播放和暂停按钮工作正常,不要在末尾添加主题标签,下一个和上一个按钮仍然有效,但添加主题标签。

我想要做的是添加 return false;到 .prev 和 .next 按钮,不使用内联 javascript(我知道如何做到这一点)并且不将链接留空(必须验证严格的 xhtml)。

【问题讨论】:

    标签: jquery xhtml return button cycle


    【解决方案1】:

    这是你要找的吗?

    $('.next, .prev').live('click', function(){
       return false;
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多