当我执行此代码时:
window.scrollTop(0,$(this).offset().top));
我的页面闪烁(白色页面显示,内容再次显示)
我尝试使用像这样的另一种方式
$('html, body').animate({ scrollTop: $(this).offset().top }, 'slow');
这个白页我的意思是闪烁仍然出现。
任何建议都可能有帮助。
最佳答案
您尝试过$.mobile.silentScroll()
吗?
来自the documentation :“$.mobile.silentScroll() - 滚动到特定的 Y 位置而不触发滚动事件监听器。”
//scroll to Y 100px
$.mobile.silentScroll(100);
关于javascript - 执行scrollTop时闪烁?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14092495/