Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

开启3D加速会让fixed失效 #54

Open
leeenx opened this issue Jul 12, 2017 · 1 comment
Open

开启3D加速会让fixed失效 #54

leeenx opened this issue Jul 12, 2017 · 1 comment

Comments

@leeenx
Copy link
Contributor

leeenx commented Jul 12, 2017

在开发过程发现以下代码,fixed 会失效:

<div class="box">
    <p></p>
</div>
.box{width:200px; height:200px; border:1px solid #CCC; -webkit-transform:translateZ(0);}
.box p{position:fixed; left:10x; top:10px; width:50px; height:50px; background-color:#000;}

按照常规渲染逻辑,fixed是相对于浏览器窗口进行定位,但对父元素开启3D加速后,它的定位参考物变成了父元素。

@deepkolos
Copy link

在这个问题我也有类似的测试, 我的测试结果是在动画暂停的时候, position:fixed + top/bottom 才会导致各种布局失效 , left/right 却是正常的 , 怪怪的..

https://www.jianshu.com/p/dc64af28d841

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants