SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    animate body, html on mobile safari - position:fixed div issue

    Hi

    I'm using the following to animate the screen;

    Code:
    function goToByScroll(id){
      $('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');
    }
    which works great on desktop browers, but on safari mobile, the menu/nav doesn't work correctly.

    The nav is inside a fixed div. When you click a button the first time it scrolls to the area fine. But after that none of the buttons work. If you move the screen slightly by finger scolling the buttons work again one more time.

    A link to the example of the work in progress is here

    Any help on this would be greatly received.

    Thanks
    Wayne

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,319
    Mentioned
    462 Post(s)
    Tagged
    8 Thread(s)
    position: fixed doesn't work on the iPhone, but there have been various solutions suggested, such as this:

    http://old.doctyper.com/archives/200...mobile-safari/

    http://davidbcalhoun.com/2011/new-mo...s-ecmascript-5

  3. #3
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    position: fixed doesn't work on the iPhone, but there have been various solutions suggested, such as this:

    http://old.doctyper.com/archives/200...mobile-safari/

    http://davidbcalhoun.com/2011/new-mo...s-ecmascript-5
    Hi Ralph.m

    Thanks for the links, I will check them out.

    Wayne

  4. #4
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just looking at the second of links, position:fixed works now on iOS5... I do remember I tried a fixed on a web build a few years back and it didn't work at all. Looking at my example in the first post, the fixed part does work, but is not fully functionable... I'm not sure what to try next..?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •