position:fixed 仅在 Firefox 47 中存在问题
position:fixed issue in Firefox 47 only
将我的 firefox 更新到版本 47.0.1 后,我发现 position:fixed
有一个奇怪的问题。
以下代码片段在 Chrome、IE 和 Firefox < 47 中运行良好。
但是,在 Firefox 47+ 中,.event2
节点不可点击...
经过一些调查,我发现可以通过删除 .g
元素的 z-index:0
来修复它。
好吧,实际上它也可以通过删除 .a
元素的 z-index:3
或删除 .f
元素的 overflow: hidden;
来修复。
修复不是问题,但我想知道是否有人知道 Firefox 47 中更改的内容...错误还是故意的?
(对我来说它看起来像一个错误...)
编辑:我在 https://bugzilla.mozilla.org/show_bug.cgi?id=1283436
上创建了一个错误报告
EDIT2:这确实是一个错误,因为它不会出现在 Firefox 48 beta
document.querySelector('.event1').addEventListener('click', function() {
alert('foo');
})
document.querySelector('.event2').addEventListener('click', function() {
alert('bar');
})
.a {
z-index: 3;
position: relative;
}
.f {
height: 50px;
width: 100%;
background-color: yellow;
overflow: hidden;
position:relative;
}
.g {
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
z-index: 0;
}
.k {
height: 50px;
width: 100%;
background-color: red;
}
.l {
position: fixed;
}
.m {
background-color: lime
}
<div class="a">
<div class="f">
<div class="g">
<div class="k event1">
<span>When it is working, this is clickable <br /> and alert (foo) <br /> </span>
<div class="l">
<div class="m event2">
<span>When it is working, this is clickable <br /> and alert (bar) then alert(foo)</span>
</div>
</div>
</div>
</div>
</div>
</div>
这确实是Firefox从46.0.1版本开始的回归
最高版本 48.0a2
对于记录,可以在此处跟踪原始错误:
https://bugzilla.mozilla.org/show_bug.cgi?id=1275411
将我的 firefox 更新到版本 47.0.1 后,我发现 position:fixed
有一个奇怪的问题。
以下代码片段在 Chrome、IE 和 Firefox < 47 中运行良好。
但是,在 Firefox 47+ 中,.event2
节点不可点击...
经过一些调查,我发现可以通过删除 .g
元素的 z-index:0
来修复它。
好吧,实际上它也可以通过删除 .a
元素的 z-index:3
或删除 .f
元素的 overflow: hidden;
来修复。
修复不是问题,但我想知道是否有人知道 Firefox 47 中更改的内容...错误还是故意的? (对我来说它看起来像一个错误...)
编辑:我在 https://bugzilla.mozilla.org/show_bug.cgi?id=1283436
上创建了一个错误报告EDIT2:这确实是一个错误,因为它不会出现在 Firefox 48 beta
document.querySelector('.event1').addEventListener('click', function() {
alert('foo');
})
document.querySelector('.event2').addEventListener('click', function() {
alert('bar');
})
.a {
z-index: 3;
position: relative;
}
.f {
height: 50px;
width: 100%;
background-color: yellow;
overflow: hidden;
position:relative;
}
.g {
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
z-index: 0;
}
.k {
height: 50px;
width: 100%;
background-color: red;
}
.l {
position: fixed;
}
.m {
background-color: lime
}
<div class="a">
<div class="f">
<div class="g">
<div class="k event1">
<span>When it is working, this is clickable <br /> and alert (foo) <br /> </span>
<div class="l">
<div class="m event2">
<span>When it is working, this is clickable <br /> and alert (bar) then alert(foo)</span>
</div>
</div>
</div>
</div>
</div>
</div>
这确实是Firefox从46.0.1版本开始的回归 最高版本 48.0a2
对于记录,可以在此处跟踪原始错误: https://bugzilla.mozilla.org/show_bug.cgi?id=1275411