我有个问题。
$(function () {
$('.drop-down').click(function(e){
$('.nav-fixed').toggleClass('open');
e.stopPropagation();
});
});我要当鼠标从#na.nav-固定。打开导航关闭10秒后
发布于 2013-07-31 07:25:18
试一试
$(function () {
$('.drop-down').click(function(e){
clearTimeout($(this).data('cleartimer'))
$('.nav-fixed').toggleClass('open');
e.stopPropagation();
});
$('.drop-down').mouseleave(function(){
var id = setTimeout(function(){
$('.nav-fixed').removeClass('open');
}, 10000);
$(this).data('cleartimer', id);
})
});演示:小提琴
https://stackoverflow.com/questions/17964043
复制相似问题