2011-02-09 63 views
0

hey 我有一些淡入淡出的工具提示,但問題是當您將一行中的按鈕翻過來時,它必須淡出完成,然後才能淡入,這樣會使某種閃爍 這是代碼javascript jquery淡入淡出

showbox:function($, $tooltip, e){ 
    $tooltip.fadeIn(this.fadeinspeed) 
    this.positiontooltip($, $tooltip, e) 
}, 
hidebox:function($, $tooltip){    
    if (!this.isdocked){ 
    $tooltip.fadeOut(this.fadeoutspeed) 
    $tooltip.css({borderColor:'black'}).find('.stickystatus:eq(0)').css({background:this.stickybordercolors[0]}).html(this.stickynotice1) 
    } 
}, 

有淡出的方式,但如果它開始衰落回無需 感謝您的幫助IM還挺一個JavaScript小白 感謝

回答

1

你可能徹底淡出想要jQuery.stop$tooltip.stop(true);

1

查看.stop()命令。 http://api.jquery.com/stop/

+0

感謝花花公子香港專業教育學院補充說,並嘗試使用的if語句'hidebox:函數($,$工具提示){\t \t \t \t如果(this.isdocked!){ \t \t \t如果(this.isdocked!){ \t \t \t \t $ tooltip.stop(true); \t \t \t} \t \t $ tooltip.fadeOut(this.fadeoutspeed) \t \t $ tooltip.css({BORDERCOLOR: '黑'})找到( 'stickystatus:EQ(0)')。CSS({背景:this.stickybordercolors [0]})。html(this.stickynotice1) \t \t}'現在淡出,但它可以卡住淡入,我已經嘗試添加不透明度的第二條if語句,但沒有運氣任何關於將不透明度提高到100%的提示都有更多的代碼,因此無論如何它可能都是不確定的部分 – reblerebel

1

是的,你可以使用.stop()方法,在該頁面上的很好的例子。