I have been struggling with fixed positioning in iPad for a while. I know iScroll and it does not always seem to work (even in their demo). I also know that Sencha has a fix for that, but I couldn't Ctrl + F the source code for that fix.
I am hoping that someone may have the solution. The problem is that fixed positioned elements do not get updated when the user pans down/up on an iOS powered mobile Safari.
here is my solution to this...
CSS
HTML
Explanation is that position fixed for the div will keep the div on the background at all time, then we stretch the div to go on all corners of the browser (provided the body margin = 0) using the (left,right,top,bottom) simultaneously.
Please make sure you do not use the width and height as this will override the top,left,right,bottom options.
A lot of mobile browsers deliberately do not support
position:fixed;
on the grounds that fixed elements could get in the way on a small screen.The Quirksmode.org site has a very good blog post that explains the problem: http://www.quirksmode.org/blog/archives/2010/12/the_fifth_posit.html
Also see this page for a compatibility chart showing which mobile browsers support
position:fixed;
: http://www.quirksmode.org/m/css.html(but note that the mobile browser world is moving very quickly, so tables like this may not stay up-to-date for long!)
Update: iOS 5 and Android 4 are both reported to have position:fixed support now.
I tested iOS 5 myself in an Apple store today and can confirm that it does work with position fixed. There are issues with zooming in and panning around a fixed element though.
I found this compatibility table far more up to date and useful than the quirksmode one: http://caniuse.com/#search=fixed
It has up to date info on Android, Opera (mini and mobile) & iOS.
now apple support that
I ended up using the new jQuery Mobile v1.1: http://jquerymobile.com/blog/2012/04/13/announcing-jquery-mobile-1-1-0/
using jquery i am able to come up with this. it doesnt scroll smooth, but it does the trick. you can scroll down, and the fixed div pops up on top.
THE CSS
THE HTML
THE jQUERY
Finally we want to determine if the ipod touch in landscape or portrait mode to display accordingly
position: fixed does work on android/iphone for vertical scrolling. But you need to make sure your meta tags are fully set. e.g
Also if you're planning on having the same page work on android pre 4.0, you need to set the top position also, or a small margin will be added for some reason.