google chrome - -webkit-transform and position:fixed + position:relative rendering issue -
it seems there issue chrome , safari when there element position:fixed contained in element position:relative , element on page has -webkit-transform. there rendering issue, bit hard explain can see here: http://jsfiddle.net/ragulka/byggh/1/
code:
<div id="sticky-container"> <div id="sticky"> <div class="test"></div> </div> </div> <div id="long"> <button class="pull-right">change color</button> <ol> <li>1. click change color. color changes.</li> <li>2. scroll down red box half-way on gray area.</li> <li>3. click change color again. color not change.</li> <li>4. scroll down more. color changes while scroll.</li> </ol> </div> <i class="icon-spin">h</i> <style type="text/css"> #sticky-container { height: 50px; position: relative; z-index: 100; } #sticky { background: red; height: 50px; width: 100px; } button { margin-top: 100px; } #sticky.blue { background: blue; } #long { height: 1000px; background: silver; position: relative; z-index: 0; } .icon-spin { display: inline-block; -moz-animation: spin 2s infinite linear; -o-animation: spin 2s infinite linear; -webkit-animation: spin 2s infinite linear; animation: spin 2s infinite linear; width: 10px; height: 10px; background: yellow; position: absolute; } @-moz-keyframes spin { 0% { -moz-transform: rotate(0deg); } 100% { -moz-transform: rotate(359deg); } } @-webkit-keyframes spin { 0% { -webkit-transform: rotate(0deg); } 100% { -webkit-transform: rotate(359deg); } } @-o-keyframes spin { 0% { -o-transform: rotate(0deg); } 100% { -o-transform: rotate(359deg); } } @-ms-keyframes spin { 0% { -ms-transform: rotate(0deg); } 100% { -ms-transform: rotate(359deg); } } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(359deg); } } </style> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js" /> <script type="text/javascript"> $(document).ready(function() { $('#sticky').affix(100); $('button').on('click', function() { $('#sticky').toggleclass('blue'); }); }) </script>
this works fine in firefox. haven't tested in ie.
does else have same issue, known bug or doing wrong?
Comments
Post a Comment