Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望在页面加载时设置页面滚动。我可以通过 div 滚动顶部或只是像素高度来设置它。
$(document).ready(function() { $(document).scrollTop(100); });
请改用 window.load,因为某些图像的加载可能会影响您的滚动位置
$(window).load(function() { $(document).scrollTop(100); });