首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >jQuery .slide和.slideUp。未打开

jQuery .slide和.slideUp。未打开
EN

Stack Overflow用户
提问于 2012-05-09 19:05:52
回答 2查看 988关注 0票数 0

我写了这个脚本:

代码语言:javascript
复制
$("#comments .comment .links").hide();
$("#comments .comment").hover(
    function() { $(".links", this).stop(true).slideDown(300); },
    function() { $(".links", this).stop(true).slideUp(300); }
);

现在我有个问题了。当我将鼠标悬停在评论div上时。我在上面徘徊了几次。该.links div不再显示。div未完全打开。

我怎么才能修复它呢?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-05-09 19:23:15

尝尝这个

代码语言:javascript
复制
$("#comments .comment .links").hide();
$("#comments .comment").hover(
    function() { $(".links", this).not(":animated").slideDown(300); },
    function() { $(".links", this).not(":animated").slideUp(300); }
);

代码语言:javascript
复制
$("#comments .comment .links").hide();
$("#comments .comment").hover(
    function() { 
                  $(".links", this).stop(true, true).slideToggle();
               }
);
票数 1
EN

Stack Overflow用户

发布于 2012-05-09 20:32:37

稍微修改一下,你就会得到这样的结果。

代码语言:javascript
复制
$("#comments .comment .links").hide();
$("#comments .comment").hover(
    function() { $(".links", this).stop(true, true).slideDown(300); },
    function() { $(".links", this).stop(true, true).slideUp(300); }
);​
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10514833

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档