在我的情況下徘徊<div>
當這樣前面加上裏面的<div>
爲什麼setTimeout()爲0 ms。在我的功能
但在一些DIV我想隱藏懸停的元素之後預謀元素一個元素的影響。
這是我的代碼和它的工作!
HTML:
<div class="one">
<span class="content"></span>
</div>
<div class="two">
<span class="content"></span>
</div>
的jQuery:
$("div.one > .content").on("hover" , function(){
var this_ = $(this);
this_.prev(".top").remove();
});
$("div.two > .content").on("hover" ,function(){
var this_ = $(this);
setTimeout(function(){this_.prev(".top").remove();})
});
.one
和.two
都是相同的功能,但我想知道爲什麼第二個功能,當我使用setTimeout()
和時序影響0毫秒,爲什麼0毫秒影響我的功能?
哦!那是 !! – l2aelba