
$('.side_con li').hover(function(){
$(this).children('.show1').hide(500);
$(this).children('.show2').show(500);
},function(){
$(this).children('.show2').hide(500);
$(this).children('.show1').show(500);
})
})
这是我写的一个鼠标放上去显示和隐藏的js代码,
我想把这个函数执行之前加一个setTimeout
大概鼠标放上去三分之一秒之后再执行函数
但是我自己不会写,研究了一下还是请百度的各位大侠帮忙了
谢谢
$('.side_con li').hover(function(){
clearTimeout(outTimer);
神伍 hoverTimer = setTimeout(function(){
$(this).children('.show1').hide(500);
$(this).children('.show2').show(500);
}, 400);
游碰或 },function(){
clearTimeout(hoverTimer);
outTimer = setTimeout(function(){
吵昌 $(this).children('.show2').hide(500);
$(this).children('.show1').show(500);
}, 400);
});