position:fixed iPhone Safari Woes

By Matthew Krivanek

As it’s being discovered, position:fixed is not working in Safari for iPhone. Obviously, the desire to have a fixed toolbar at the top or bottom is going to almost a requirement for many web app developers.

So, the first thing that came to my mind was to manually keep positioned elements fixed via JavaScript. No luck here either! If you pull up http://www.quirksmode.org/viewport/experiments/scrolling2.html in your iPhone, you’ll note that neither of the following work:pageXOffset and pageYOffsetdocument.body.scrollTop and document.body.scrollLeftHas anyone found a work around?

Come on Apple, if you’re going to state that Safari for the iPhone is as powerful as the desktop version, please enable it to do basic CSS2 and JavaScript functions!

Update: I’ve found a workaround which uses an auto-scrolling div. The catch is, in order to scroll, you must use two-fingers, identical to the way you’re able to do with MacBook trackpads. This seems like a viable solution, however, there are several trade-offs:

One, the slick physics behind the iPhone scroll are no longer present, and two, there are obvious usability issues with this solution. For almost all webpages, the user is able to scroll using just one finger. How then, would they know that for certain pages, two fingers were necessary. Not a very desirable solution to me.

Check out our example here: http://www.launchpadhq.com/experiments/test1.html

Bookmark: del.icio.us Digg Reddit Ma.gnolia Technorati

5 comments so far

  1. BstCredtCord November 2, 2007 11:18 pm

    Hi, everybody. I am going to get married but my boyfriend and I are still running credit card debt we made when at college yet. They say that we’d better improve our credit ratings if we want to apply for a loan to celebrate the wedding. So, now we both are looking for bad or fair credit card applications to repair our scores. We wonder if

    credit cards for medium to bad credit

    mc216d

  2. Idetrorce December 15, 2007 5:28 am

    very interesting, but I don’t agree with you
    Idetrorce

  3. John Svid February 25, 2008 7:14 am

    Wow great site! Some really helpful information there.
    I’m sorry for little off-topic, but I want to ask you about design of this site.
    Did you make this template yourself or got from any templates website?
    Looks pretty cool for me. Wonderful well this reading.

  4. jonnyboy24 April 10, 2008 11:18 pm

    You are the brick! Reading stuff like this written in the way like this is a great pleasure for me.

  5. zek April 15, 2008 6:06 am

    Looks pretty cool for me. Wonderful well this reading.

Leave a comment

Please be polite and on topic. Your e-mail will never be published.