我有通知出现在屏幕的左上角。他们在5秒钟的延迟时间内被移除。如果用户徘徊在一个以上,它应该被删除。防止元素被移除,如果鼠标上移
这里是我的jQuery代码
$alert.on('mouseover', function() {
clearTimeout(growl_remove);
});
growl_remove = setTimeout(function() {
return $alert.alert("close");
}, 5000);
下面是HTML
<div class="growl col-xs-12 col-sm-12 col-md-3 alert alert-danger" style="position: fixed; margin: 0px; z-index: 9999; top: 26.846393585205078px; right: 20px;">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<span class="glyphicon glyphicon-ban-circle"></span> Invalid Username or Passowrd
</div>
现在,这似乎工作,但它停止从被删除不是一个用鼠标的最后警告超过它。
这里是一个的jsfiddle:http://jsfiddle.net/KU5gy/
听起来像一个封闭的问题。请分享HTML,也许把一个jsFiddle放在一起。 – BenM