PDA

View Full Version : go to bottom of page


Homer
07-31-2002, 09:57 AM
I want the user to be taken automatically to the bottom of my index page and not the top when the page is launched, is this possible? Does anyone have a simple answer.

Regards

Homer

Mhtml
07-31-2002, 10:51 AM
put <a name="bottom" just before the </body> tag.
then in the <body> tag put this attribute onLoad="#bottom"

so it will look like this.

<html>
<head>
<title>Your Site</title>
</head>
<body onLoad="#bottom">
Your content is here
<a name="bottom">
</body>
</html>

Easy enough?

boxer_1
07-31-2002, 01:23 PM
You could use scrollTo. In this example , self.scrollTo(0,50), "0" represents the number of pixels to scrollTo horizontally and "50" represents the number of pixels to scrollTo vertically. So, to go to the bottom of a particular page, just make the second value exeed the height of your page (enough to accomodate for different resolutions. Here's an example:

<html>
<head>
<title>Example</title>
</head>
<body onLoad="self.scrollTo(0,2000);">
Hello World!
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
The End!
</body>
</html>

Just add the bolded as shown and adjust the values to suit yourself :thumbsup: .

Mhtml
08-01-2002, 08:30 AM
I've never seen that done boxer...interesting.