View Full Version : jumptop
emanuelle
09-17-2007, 07:38 PM
http://www.dynamicdrive.com/dynamicindex5/jumptop.htm
I am using this script but I need to place it on a particular place in the page. How do I change the location?
thetestingsite
09-17-2007, 07:45 PM
Do you just need a link to jump to the top of the page in a specific spot on the page, or do you still want the link to scroll down the page when the user scrolls?
If the first, you don't even need to use that script. Simply make a link and place this in the onclick attribute:
window.scrollTo(0,0); return false;
so it would look like this:
<a href="#top" onclick="window.scrollTo(0,0); return false;">Top</a>
If the latter option, I'm not sure. Hope this helps nonetheless.
boogyman
09-17-2007, 07:50 PM
<a href="window.location.reload()">Return To Top</a>
just place that whereever you wish to have jump to top... the script he is using is fixed to stay at the bottom right hand corner of the screen
emanuelle
09-17-2007, 07:52 PM
I still want the link to scroll down the page when the user scrolls
thetestingsite
09-17-2007, 08:02 PM
This line in the js file:
document.write('<span id="logo" style="position:absolute;top:-300px;z-index:100">'+displayed+'</span>')
is where you would change the position of the link using CSS styling.
Hope this helps.
boogyman
09-17-2007, 08:03 PM
okay so you want it in a different spot? where do you want it? top left? top right? bottom left?
document.write('<span id="logo" style="position:absolute;top:-300px;z-index:100">'+displayed+'</span>')
i would think for best possible results on whereever you want it would be to use some "reverse" logic...
like ifyou wanted bottom left use
position:absolute;bottom:0;left:0;z-index:100
emanuelle
09-17-2007, 08:11 PM
i want to place it in a particular TD tag
so what do I change to the style?Position:relative?
boogyman
09-17-2007, 08:23 PM
if you want to place it in a specific tag id, then you wont want it to scroll with the page. like the script does... if you want to do it that way.. you would use either testingsite or my method...
replace the coordinates in that line that was referenced
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.