CSS position:fixed not working

6,891 views
Skip to first unread message

MikeG

unread,
Aug 9, 2011, 2:30:30 PM8/9/11
to phonegap
Hi,
it was a well known issue with Android browser what CSS position:fixed
was not supported till version 2.2. But with modern sdk it suppose to
work fine. But still it seams that PhoneGap 1.0 does not support
position:fixed.
Are there any plans to fix that, or are there workarounds?
Basically what I want is to have only part of the app content
scrollable, with some fixed menus on the top and bottom of the screen.
Any suggestions are welcome.

Thanks,
Mike

Todd

unread,
Aug 10, 2011, 11:22:37 AM8/10/11
to phonegap
I would assume any css styles are completely up to the os's web view/
device and not phone-gap, but maybe I'm wrong?

AbhishekKanitkar

unread,
Aug 11, 2011, 2:47:39 AM8/11/11
to phonegap
You are right on this Todd. I have faced this issue on Android before
& this limitation of not able to do scrolling in fixed area on Android
led to learn Sencha Touch, which offers good ways to do that, but the
learning curve is quite steep.

http://www.sencha.com/learn/touch/

Devgeeks

unread,
Aug 11, 2011, 4:36:55 AM8/11/11
to phon...@googlegroups.com
Also, iScroll (and appML that uses it) allow for fixed areas top/bottom/left/right with scrolling areas between.

Works quite well.

Mikhail Gerdov

unread,
Aug 12, 2011, 12:59:07 PM8/12/11
to phon...@googlegroups.com
Ok. thanks for suggestions. I will check them out.
I made position:fixed to work by disabling user zoom feature of the viewport. Add this line to the head of the html document:

<meta name="viewport" content="target-densityDpi=device-dpi, width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />

user-scalable=no is where all the magic is.

thanks,
Mike



On Thu, Aug 11, 2011 at 5:36 AM, Devgeeks <to...@devgeeks.org> wrote:
Also, iScroll (and appML that uses it) allow for fixed areas top/bottom/left/right with scrolling areas between.

Works quite well.

--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en

For more info on PhoneGap or to download the code go to www.phonegap.com



--
Best regards,
Mikhail Gerdov                                     mailto:ger...@gmail.com

Nikos Papanikolaou

unread,
Oct 4, 2012, 8:10:37 PM10/4/12
to phon...@googlegroups.com
i tried position:fixed on android 2.35 and didn't work..then found his answer from Mike..and actually does the trick..
 
however, it messes with the scaling (like overflow hideen effect) of the device but if i add only this line

<meta name="viewport" content="user-scalable=no" />

it seems to do the trick and not have the scaling issue on some tabs that i have made..

so here comes the question..is it safe to use only

<meta name="viewport" content="user-scalable=no" />

or the rest of the info should be added as well?

Nikos Papanikolaou

unread,
Oct 6, 2012, 7:40:02 PM10/6/12
to phon...@googlegroups.com
has anyone noticed any delay loading the divs with position fixed attribute?

gurunathan natarajan

unread,
Oct 28, 2013, 10:51:53 AM10/28/13
to phon...@googlegroups.com
Hi Mike G

I developing Windows phone 7 App Using Phonegap 2.9.0

I want To use Fixed Footer Body content Must Be Scroll But Footer Still in Same Position In Both horizontal and vertical potion.

I need Your Sample Code For Fixed position ....

Thank you

Reply all
Reply to author
Forward
0 new messages