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.
我有一个网站,我希望用户可以上下滚动多少。这意味着无论页面的内容是什么,滚动能力都不应低于这个给定的数量。
如何在 Javascript 中设置它?
你可以这样做:
CSS:
HTML { height: 100%; padding-bottom: 200px; padding-top: 200px; }
JS:
window.onload = function () { document.body.scrollIntoView(true); return; }