使用 jQuery 跳转到页面底部 - 没有动画
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18334866/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Jump to the bottom of the page with jQuery - Without animation
提问by Evanss
How can I jump to the bottom of the page with jQuery?
如何使用 jQuery 跳转到页面底部?
I don't want a smoother animation, just to 'jump'. All the other questions on this site I found seem to involve an animation.
我不想要更流畅的动画,只是为了“跳跃”。我在这个网站上发现的所有其他问题似乎都涉及动画。
回答by iConnor
This will do
这会做
$('html, body').scrollTop( $(document).height() );
回答by Deepak Biswal
WITH ANIMATION
带动画
$("html, body").animate({ scrollTop: $(document).height() }, "slow");
WITHOUT ANIMATION
没有动画
$('html, body').scrollTop( $(document).height() );
回答by Bibhu
You can use an anchor tag for this, no need of jquery.
您可以为此使用锚标记,不需要 jquery。
Put an anchor tag at the bottom of the page just before </body>
tag. such as
将锚标记放在页面底部的</body>
标记之前。如
<a name="pageend"></a>
And, from where on the page you can jump to the bottom, put another anchor tag just like this.
并且,从页面上您可以跳到底部的位置,像这样放置另一个锚标记。
<a href="#pageend">Jump to page end</a>
回答by Amir Rahman
$('#smthn').scrollTop(99999999999);
$('#smthn').scrollTop(99999999999);
99999999999 is the max input for jquery and it can take element to the last scrolling position.
99999999999 是 jquery 的最大输入,它可以将元素带到最后一个滚动位置。