Skip to content

Instantly share code, notes, and snippets.

@diyism
Last active December 24, 2015 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diyism/6851522 to your computer and use it in GitHub Desktop.
Save diyism/6851522 to your computer and use it in GitHub Desktop.
fixed容器内translateZ(0)的元素会导致所有兄弟元素脱离容器的bug(on android 2.2/2.3 browser/webivew)
<script src="zepto.min.js"></script>
<div style="position:fixed;border:1px solid red;" id="pageWrapper">
<div style="z-index:1;top:0px;height:100px;width: 300px;background-color:green; -webkit-transform: translate(0px, 0px) scale(1) translateZ(0);" id="kkkk">kkkkkk</div>
</div>
<script>
$('#kkkk')[0].clientHeight;//relocate #jjjj into #pageWrapper
$('#pageWrapper').append('<div style="background-color:yellow; z-index: 100; height: 7px; position:absolute;top:14px;width:320px;-webkit-transform:translateZ(0);" id="jjjj"></div>');
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment