简体   繁体   English

jQuery scrollTop 在 iOS 12 上不滚动

[英]jQuery scrollTop not scrolling on iOS 12

I want to scroll to a div with this code and it doesn't work on iOS 12, it works on all other versions up from 12 and on Android, web as well.我想使用此代码滚动到一个 div,但它不适用于 iOS 12,它适用于 12 以上的所有其他版本以及 Android、web 以及。 What could be the problem.可能是什么问题呢。

setTimeout(function(){
    $('html').animate({
        scrollTop: $("#filtered-results").offset().top-400
    }, 1000)
}, 100);

Try this尝试这个

setTimeout(function(){
     $('body').animate({
         scrollTop: $("#filtered-results").offset().top-400
     }, 1000)
}, 100);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM