i got the following problem: I got a h2, nested in a div with the id : <div id="hidediv1">.
I got this code
我遇到了以下问题:我得到了一个h2,嵌套在一个id为div的div中:
$("#hidediv1").mouseover(function(){
$('#hide1').show(500);
});
$("#hidediv1").mouseleave(function(){
$('#hide1').hide(500);
});
I want it to be, that you have to hover over the div for atleast 1 second to trigger it. I know, there are several questions on *, but i coulnd't apply them to my code.
Please help!
Thank you.
我希望它是,你必须在div上盘旋至少1秒才能触发它。我知道,*有几个问题,但我不会将它们应用到我的代码中。请帮忙!谢谢。
2 个解决方案
#1
1
You can delay it using:
你可以使用以下方法延迟它
$("#hidediv1").mouseenter(function() {
$('#hide1').delay(1000).show(500);
}).mouseleave(function() {
$('#hide1').stop(true).hide(500);
});
stop(true)
would avoid some queue pending issue.
stop(true)会避免一些队列待决问题。
BTW, you have better in most cases to use mouseenter
instead of mouseover
.
顺便说一句,在大多数情况下你最好使用mouseenter而不是mouseover。
#2
0
$(document).ready(function(){
$("#div1").mouseover(function(){
$("#div2").hide(1000);
});
$("#div1").mouseout(function(){
$("#div2").show(1000);
});
});
Try this..
尝试这个..
#1
1
You can delay it using:
你可以使用以下方法延迟它
$("#hidediv1").mouseenter(function() {
$('#hide1').delay(1000).show(500);
}).mouseleave(function() {
$('#hide1').stop(true).hide(500);
});
stop(true)
would avoid some queue pending issue.
stop(true)会避免一些队列待决问题。
BTW, you have better in most cases to use mouseenter
instead of mouseover
.
顺便说一句,在大多数情况下你最好使用mouseenter而不是mouseover。
#2
0
$(document).ready(function(){
$("#div1").mouseover(function(){
$("#div2").hide(1000);
});
$("#div1").mouseout(function(){
$("#div2").show(1000);
});
});
Try this..
尝试这个..