I've been messing with this all day and can't seem to find a fix.
I've got a simple ul that acts as a fixed header with the following css:
body {
width: 100%;
height: 100%;
min-height: 100%;
}
.stream .header {
position: fixed;
width: 100%;
height: 41px;
top: 0;
right: 0;
left: 0;
z-index: 10;
margin-bottom: 10px;
list-style: none;
}
The content below the header has the following css:
.stream .stream-content {
position: relative;
padding-top: 41px;
-webkit-transform: translate3d(0, 0, 0);
}
When the page is scrolled in ios7 mobile safari, the following happens:
first scroll down -- header moves along with page top fine until scrolling is complete.
second scroll down -- header disappears completely and does not reappear when scrolling is complete.
scroll up (with header still visible) -- header disappears completely and does not reappear when the top of the page is reached.
scroll up (with header hidden) -- header stays hidden and does not reappear when the top of the page is reached.
scroll up (already at top of page with header hidden) -- header reappears and functions normally until page is scrolled down twice.
I wasn't having this issue with iOS6 mobile safari, so the issue seems related to the new url bar resizing on scroll.
Anyone else having similar issues? Suggestions welcome.
Update:
So it appears that removing -webkit-transform3d() on the header's parent (.stream) removes the issue, so there must be a conflict the way the parent div is being rendered and the header inside.
Still looking for a work around though.
I was having the same issue, it seems to be a bug that occurs when there is too much going on inside the page, I was able to fix it by adding the following transform code to the fixed position element, (transform: translateZ(0);-webkit-transform: translateZ(0);
) that forces the browser to use hardware acceleration to access the device’s graphical processing unit (GPU) to make pixels fly. Web applications, on the other hand, run in the context of the browser, which lets the software do most (if not all) of the rendering, resulting in less horsepower for transitions. But the Web has been catching up, and most browser vendors now provide graphical hardware acceleration by means of particular CSS rules.
Using -webkit-transform: translate3d(0,0,0); will kick the GPU into action for the CSS transitions, making them smoother (higher FPS).
Note: translate3d(0,0,0) does nothing in terms of what you see. it moves the object by 0px in x,y and z axis. It's only a technique to force the hardware acceleration.
#header {
position: fixed;
/* MAGIC HAPPENS HERE */
transform: translateZ(0);
-moz-transform: translatez(0);
-ms-transform: translatez(0);
-o-transform: translatez(0);
-webkit-transform: translateZ(0);
-webkit-font-smoothing: antialiased; /* seems to do the same in Safari */
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With