2010-06-11 66 views

回答

1

編輯。 借用另一個堆棧溢出問題。 它在這裏工作:http://jsfiddle.net/mmRu2/

jQuery.fn.delay = function(time,func){ 
    return this.each(function(){ 
     setTimeout(func,time); 
    }); 
}; 

$('#search').delay(2000, function(){ 
    $('#search').fadeOut('fast'); 
    } 
); 
+4

哈哈,剛纔的搜索欄加載:) – Kyle 2010-06-11 07:41:58

+0

編輯後淡出慢慢地,並把測試的鏈接給你。 – 2010-06-11 09:03:21

5

之後碼放在

setTimeout(function() { 
    $(".tooltip").fadeOut("slow"); 
}, 4000); 
+0

對不起,這並沒有讓它淡出。沒有效果。 – Kyle 2010-06-11 07:46:22

+0

@Kyle Sevenoaks 奇怪,因爲.tooltip是工具提示的標識符。 – nebkat 2010-06-11 07:51:25

0

試試下面的回調...希望它會工作......但我會褪色不透明度0.8 ... u能改變休息...

onShow: function() { 
     this.getTrigger().fadeTo("slow", 0.8); 
    } 
2

你試圖延遲?

$("#search").tooltip({ offset: [45, 170], delay: 4000, effect: 'slide' }); 
+0

正是我以後,謝謝:) – Kyle 2010-06-11 07:56:04

+0

看來,這是一個當鼠標不見了,不是從一開始... http://flowplayer.org/tools/tooltip/index.html – nebkat 2010-06-11 07:56:48

+0

這是非常真實的,但它現在會做。 :) – Kyle 2010-06-11 07:59:06

1

這些答案都不適用於我。賈馬爾接近了,但錯過了重要的部分。

工作代碼4秒後隱藏工具提示:

<script> 
$("s.howTooltip").tooltip({ 
    //start when the tooltip is shown 
    onShow: function() { 
    //store a reference to this 
    var self = this; 
    //start a timeout for 4seconds 
    setTimeout(function() { 
     //get a reference to the tooltip and hide it. 
     self.getTip().hide(); 
    }, 4000) 
    } 
}) 
</script> 
+0

getTip()突然從哪裏來? – bart 2017-10-20 21:46:26