JavaScript单击并隐藏问题Firefox
javascript click and hide issue firefox
>我正在尝试创建一个菜单,当您单击页面上的其他任何位置时,div将被隐藏。这适用于除火狐之外的所有内容。在 Firefox 中,当您单击该部分中的链接之一时,它不会转到该链接,它只会关闭div。
法典:
$(document).mouseup(function(e){//removes menu when clicked on any other part of page
if($(".menuone:visible").length > 0 ){
$('.menuone').hide();
}
});
.HTML:
<div class="menuone">
<div class="col1">
<ul><li>Example link</li></ul>
</div>
</div>
你应该设置一个变量来跟踪 .menuonediv 的悬停状态。
那么你的if语句将是:
if($(".menuone:visible").length > 0 && !menuHover )
这应该可以解决问题。
希望对:)有所帮助
编辑:
var menuHover = false;
$(".menuone").bind('mouseenter mouseleave',function(e){
menuHover = e.type == 'mouseenter';
});
我喜欢John Resig网站上提到的想法:
var outerPane = $details.find(".details-pane-outer"),
didScroll = false;
$(window).scroll(function() {
didScroll = true;
});
setInterval(function() {
if ( didScroll ) {
didScroll = false;
// Check your page position and then
// Load in more results
}
}, 250);
相关文章:
- Firefox奇怪的问题
- Firefox事件.目标问题
- 如果选项被禁用,则多个下拉菜单会导致FIREFOX出现问题
- firefox中的Javascript事件范围问题
- Firefox 15中的HTML5问题
- jQuery - 与 Firefox 的兼容性问题
- 我的Firefox插件和跨域https存在问题
- 俄罗斯木偶与Firefox和Webkit的显示问题:与IE配合良好
- Node.js/Socket.io适用于除Firefox之外的所有应用程序,这可能是缓存问题
- firefox中的浮动元素问题
- Firefox的问题是列出当前目录中的所有文件名
- Firefox与jquery.post的问题
- 在Firefox OS应用程序中滚动时出现渲染问题
- 我想使用的模板上的Firefox和IE的对齐问题
- Cookie不适用于Chrome,但它'使用Firefox(localhost)没问题
- 当内容显示在FireFox的iFrame中时,jQuery高度问题
- JavaScript单击并隐藏问题Firefox
- 使用angular js的验证问题(firefox上显示红色边框)
- 拖放问题firefox
- 单击“选择验证问题”(Firefox) 上的事件