在某个滚动点处启动页面

问题描述:

有一种方法(使用CSS3,JS或其间的任何东西)来获取页面在某一点开始滚动吗?

Is there a way (with CSS3, JS, or anything in between) to get a page to start at a certain point scrolled down?

为我的页面加载,而不是头部最初显示在加载(意味着它在用户的实际视口上方)。

I'd like for my page to load without the header initially displaying on load (meaning it's above the actual viewport of the user).

有一个简单/容易的方法去?

Is there a simple/easy way to go about this?

您可以使用标准javascript:window.scroll(x,y)

You can use standard javascript: window.scroll(x, y).

考虑到你会在 onload 这样做,即窗口应该从(0,0)开始。用(x,y)玩,直到你的标题到你喜欢的位置。

This should work pretty well considering that you'll be doing this at onload, i.e. the window should begin at (0, 0). Play around with (x, y) until you get your header to the position that you're happy with. Naturally you'll need to change it anytime the header moves.

例如:

<body onLoad="window.scroll(0, 150)">