Is there any compatibility between ios and Android in the absolute location of elements? I have solved some of them, but the positioning on IOS is still inconsistent with Android.

I use the following two methods to achieve the animation effect of imitating anchor point positioning. There is no problem in Zhuo system, but the positioning position in IOS is not accurate. Is there a compatibility problem?

related codes

    //
    function getElementTop(element){
var actualTop = element.offsetTop;
var current = element.offsetParent;
        
while (current !== null){
actualTop += current.offsetTop;
current = current.offsetParent;
}
return actualTop;
}
    //
    function scrollTo(y, duration) {
        /*y:,duration:()*/
        var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
        var distance = y - scrollTop;/*0,,0,*/
        var scrollCount = Math.ceil(duration / 10);/*10,*/
        var everyDistance = distance / scrollCount/**/
        for (var index = 1; index <= scrollCount; indexPP){ /*scrollBy,duration,*/
        setTimeout(function () { window.scrollBy(0, everyDistance) }, 10 * index);
        }
        
    }

look forward to God to help me see what happened. Thank you very much

Jul.04,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be5c49-317ad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be5c49-317ad.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?