开发者

How do I make a webpage scroll from the bottom?

Is it possible to start a w开发者_开发问答ebpages scroll from the bottom, I have gotten it working with this little snippet of code

$('a#bottom').trigger('click')

where a#bottom is an anchor to the bottom of the page. Is there a better way than using the trigger.

I would like the page to always load at the bottom... is it possible?


you can set a redirect like:

location.href = <thecurrenturl>+"#bottom"

But it doesn't differ much from your method. Anchors are best since adjusting scroll amounts isn't the same across browsers.


You can include the bookmark when you load the page, e.g. SomePage.html#bottom. That will make the browser jump to the bookmark when the page loads.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜