我用我的網站這個代碼鼠標離開,我想知道我怎麼能延遲添加到鼠標離開功能添加延遲的jQuery
$target.mouseenter(function(e){
var $tooltip=$("#"+this._tipid)
ddimgtooltip.showbox($, $tooltip, e)
})
$target.mouseleave(function(e){
var $tooltip=$("#"+this._tipid);
setTimeout(function() { ddimgtooltip.hidebox($, $tooltip); }, 4000);
})
$target.mousemove(function(e){
var $tooltip=$("#"+this._tipid)
ddimgtooltip.positiontooltip($, $tooltip, e)
})
if ($tooltip){ //add mouseenter to this tooltip (only if event hasn't already been added)
$tooltip.mouseenter(function(){
ddimgtooltip.hidebox($, $(this))
})
謝謝你真棒,現在當我鼠標懸停另一個有沒有辦法我可以跳過那個超時? – 2010-09-14 14:16:10
@Dustin - 是的,但我不能說沒有看到你的'mouseenter'函數爲其他元素,需要多一點上下文添加到問題。 – 2010-09-14 14:31:00
我更新了代碼,謝謝你的幫助 – 2010-09-14 14:38:19