How to load a web page at the bottom of the site.

I am creating a reverse site, which means that the open spot on the page is at the bottom, and you scroll up to go through the content. A simple command to explain what I mean is http://url.com/#bottom (or #footer). However, I want it to be unnecessary to create an "ENTER" site page that displays the #bottom line, and I cannot use URL redirection for any # address.

No, I'm not trying to fake any free server or anything else, you can check what I'm trying to do on Sean-holt.com. (note im at the beginning of the work, but just go to the bottom and then scroll up, I want the site to open in a picture of the world).

I just want the first place the viewer sees to be the bottom of the page, and then scroll up.

How can i do this?

Many thanks for your help!!!!! you guys rock!

(PS This is the first time I've used a stack overflow!)

+1
source share
4 answers

I think you should do it with Javascript / jQuery instead of redirecting again

Put this in the main tag of your file

<script> // after dom is loaded $(function() { // scroll all the way down $('html, body').scrollTop($(document).height() - $(window).height()); }); </script> 
+2
source
 <body onload="window.location.hash = 'footer'"> 

If the footer has id="footer" .

+1
source

This may be useful for you.

http://demos.flesler.com/jquery/scrollTo/

I have not used this, but may be useful to you.

0
source

Dan Li's idea is great. Just add or subtract something to achieve your ideal position.
I did it like this:

 <script> // after dom is loaded $(function() { // scroll all the way down $('html, body').scrollTop($(document).height() - ($(window).height() + 280)); }); </script> 
0
source

Source: https://habr.com/ru/post/1435628/


All Articles