2012-05-09 30 views
0

我必須讓這個腳本:jQuery .slide和.slideUp。不開

$("#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並未完全打開。

我該如何解決這個問題?

+1

嘗試在停止處添加另一個true'.stop(true,true)' – Joonas

+0

您可以發佈與腳本相關的html嗎? –

回答

1

試試這個

$("#comments .comment .links").hide(); 
$("#comments .comment").hover(
    function() { $(".links", this).not(":animated").slideDown(300); }, 
    function() { $(".links", this).not(":animated").slideUp(300); } 
); 

OR

$("#comments .comment .links").hide(); 
$("#comments .comment").hover(
    function() { 
        $(".links", this).stop(true, true).slideToggle(); 
       } 
); 
1

稍加修改,你有這一點。

$("#comments .comment .links").hide(); 
$("#comments .comment").hover(
    function() { $(".links", this).stop(true, true).slideDown(300); }, 
    function() { $(".links", this).stop(true, true).slideUp(300); } 
);​