Reputation: 1336
I am creating a reverse site, meaning the opening spot on the page is at the bottom and you scroll up to go through content. a simple command to explain what i mean is http://url.com/#bottom (or #footer). However i want to avoid having to create an "ENTER" site page that lines to #bottom and i cannot use a URL redirect to any #adress.
No im not trying to spoof some free server or something, you can checkout what im trying to do at Sean-holt.com. (note im still in the beginning of the work. but just go to the bottom and then scroll up, I want the site to open at the picture of the world).
I just want the first place the viewer to see is the bottom of the page and then have to scroll up.
How can i accomplish this?
Thanks a lot for your help!!!!! you guys rock!
(P.S. This is the first time i have used stack Overflow!)
Upvotes: 1
Views: 10160
Reputation: 1
Dan Lee's idea is great.. Just add or subtract something to achieve your ideal position.
I've done it like this:
<script>
// after dom is loaded
$(function() {
// scroll all the way down
$('html, body').scrollTop($(document).height() - ($(window).height() + 280));
});
</script>
Upvotes: 0
Reputation: 14492
I think you should do it with Javascript/jQuery instead of redirecting again
Put this in the head tag of your file
<script>
// after dom is loaded
$(function() {
// scroll all the way down
$('html, body').scrollTop($(document).height() - $(window).height());
});
</script>
Upvotes: 2
Reputation: 12806
<body onload="window.location.hash = 'footer'">
Where the footer has id="footer"
.
Upvotes: 1
Reputation: 1317
This can be useful for you.
http://demos.flesler.com/jquery/scrollTo/
I did not use this but may be useful for you.
Upvotes: 0