The event of embedding Apple app scrollTop () into Web page on mobile is invalid.

css:

html,body{margin: 0;/*width:100%;height:100%;*/position: relative;-webkit-overflow-scrolling: touch;}
-sharpmain,-sharpmain>div{width:1000px;height:1000px;margin:0 auto !important;box-sizing: border-box;position: absolute !important;left:50% !important;top:50% !important;margin-left: -480px !important;margin-top: -480px !important;overflow: auto !important;}
    

html layout:

<div id="outer"><div id="main"></div></div>

js:

$("-sharpouter").css({"width" : $(window).width(), "height" :$(window).height()});
    $(window).scrollLeft(200);
    $(window).scrollTop(200);
    $("-sharpmain").scrollLeft(200);
    $("-sharpmain").scrollTop(200);

web page is valid to access the page with mobile phone;
embedded Android app is normal, ios iPhone app.scrollLeft ();. ScrollTop (); event is invalid

Aug.27,2021

For

bug reasons, the .scrollTop () event has been executed before the plug-in has finished rendering. If the event is placed after the page has finished loading, the bug, will not appear, that is,

.
window.onload = function(){
    setTimeout(function () {
        if(dataStr) {
            if(!($('-sharpmain').hasClass('fullwidth'))){
                $(window).scrollLeft(300);
                $(window).scrollTop(350);
            }
        }
    },200);
};   
Menu