Fixed div in Mobile Safari

Does any one know of a way to created floating div elements for mobile safari. Safari on the desktop of course supports this, but mobile safari and UIWebView do not seem to. Work arounds and suggestions welcome.

Thanks in advance for all advice.
Rakesh

Macbook, Mac OS X (10.5.3)

Posted on Jun 30, 2008 8:15 PM

Reply
11 replies

Jul 1, 2008 5:46 AM in response to orangekay

Yes. I have something along these lines:

// In CSS file
.navigation
{
background-color: #336699;
position: fixed;
top: 80px;
left: 0;
height: 50px;
width: 100%;
padding: 5px;
vertical-align: middle;
}

// In HTML file
<div id='navigation' class='navigation'>
<span id='welcome'><a href='javascript:welcome()'>Welcome</a></span>
<span class='separator'>|</span>
<span id='rules'><a href='javascript:rules()'>Rules</a></span>
<span class='separator'>|</span>
</div>

This works fine when I test with desktop Safari but not on the simulator (Safari or UIWebView).

Thanks for all help.
Rakesh

Message was edited by: sptrakesh

Jul 29, 2008 1:16 PM in response to sptrakesh

I have the same problem. I just noticed that a small but critical position:fixed page element I’m using is ... well, it’s definitely not “fixed” in mobile Safari. It scrolls of the screen, instead of remaining on the page the way I want it to. This is a bit of a deal-breaker the way I’m using it. A few % of my visitors are on iPhones, so yikes. They’re pretty much hosed until I find a workaround. I’ll post here again if I find anything.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Fixed div in Mobile Safari

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.