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

后端 未结 11 2204
别跟我提以往
别跟我提以往 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:39

    A variation of this worked for me as well. Trying to not use frameworks where I can on mobile.

        var d = document.createElement("div");
        d.style.height = "101%";
        d.style.overflow = "hidden";
        document.body.appendChild(d);
        window.scrollTo(0, scrollToM);
        setTimeout(function() {
            d.parentNode.removeChild(d);
        }, 10);
    

提交回复
热议问题