Fixed position navbar only clickable once in Mobile Safari on iOS5

前端 未结 3 373
悲&欢浪女
悲&欢浪女 2020-12-12 19:48

I\'m using Twitter Bootstrap to style an iPad optimized website and am running up against an interesting bug in Mobile Safari on iOS5.

After tapping on an anchor lin

3条回答
  •  伪装坚强ぢ
    2020-12-12 20:27

    I feel your pain. I spent at least 6 hours trying to figure this one out. But I did, at least a sweet workaround that worked for me.

    I have a fixed header with navigation in it as many headers have. The body/html scrolls up down underneath it. (typical)

    After clicking a nav button, the page scrolls and effectively kills my buttons until I physically scroll my body again with my finger. This somehow makes my buttons clickable again. I tried everything and nobody seemed to have solved it , or didn't share results.

    html:: At the end of my container div, i added an empty div, with no height/width

       

    js:: Just before the scroll animation, i give the div height of 200px.

    $('#device').css('height', '200px');

    immediately on complete of the animation, i take the height away

    $('#device').css('height', '0px');  

    That is it. Sweet hack magic. I hope that helps. If you want a working example, http://ryanore.com Currently I'm in progress so I wouldn't normally drive any links to it, but hey it's for a good cause.

提交回复
热议问题