2010-06-11 68 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