【问题标题】:Conflict with jscrollPane and animate与 jscrollPane 和 animate 冲突
【发布时间】:2011-08-24 02:31:49
【问题描述】:

我在通过 jquery animate 函数显示的 div 上使用 jscollPane。

animate 函数似乎与 jscrollpane 脚本发生冲突,因此滚动条不显示。

这里是一个示例页面来演示:http://mikesewell.net/dev/scrollpane/

div #text 使用 display: none; 隐藏它使用这个函数显示:

$(".bio-button").hover(function() {
        $(this).next("#text").animate({opacity: "show"}, "slow");
    }

如果我不隐藏#text jscrollPane 可以正常工作,但如果使用此函数进行动画处理,则滚动条会停止显示。

任何建议将不胜感激。谢谢!!

【问题讨论】:

    标签: jquery


    【解决方案1】:

    代替:

     $(this).next("#text").animate({opacity: "show"}, "slow");
    

    试试这个:

    $('#text').fadeIn('slow');
    

    id="text" 应该只有一个 div,因此无需遍历 DOM 即可找到它。

    另外,根据JQuery Docs

    与 .slideDown() 和 .fadeIn() 等速记动画方法不同, .animate() 方法不会使隐藏元素作为 效果。

    【讨论】:

    • 我尝试使用 $('#text').fadeIn('slow');但结果还是一样。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-01-23
    • 2012-04-15
    • 2011-09-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多