Mobile Safari bug on fixed positioned button after scrollTop programmatically changed…?

后端 未结 11 2202
别跟我提以往
别跟我提以往 2020-11-28 04:10

I\'m just about done a webpage but there is one bug in Mobile Safari (iPhone and iPad iOS 5.0.1) with two buttons that are fixed to the upper and lower right corners..

11条回答
  •  情深已故
    2020-11-28 04:27

    In case it can help someone:

    I had the exact same problem, and my code looked something like this (it's a single-page webapp):

    window.scrollTo(0,0);
    $('section.current').removeClass('current');
    $(target).addClass('current');
    

    I spent hours trying everything (101% height divs, changing the position type...), but finally the last suggestion described on Device-Bugs saved the day. In my case it was just a matter of scrolling when the divs aren't rendered:

    $('section.current').removeClass('current');
    window.scrollTo(0,0);
    $(target).addClass('current');
    

提交回复
热议问题