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?
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?
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:
so it would look like this:Code:window.scrollTo(0,0); return false;
If the latter option, I'm not sure. Hope this helps nonetheless.Code:<a href="#top" onclick="window.scrollTo(0,0); return false;">Top</a>
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
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 screenCode:<a href="window.location.reload()">Return To Top</a>
I still want the link to scroll down the page when the user scrolls
This line in the js file:
is where you would change the position of the link using CSS styling.Code:document.write('<span id="logo" style="position:absolute;top:-300px;z-index:100">'+displayed+'</span>')
Hope this helps.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
okay so you want it in a different spot? where do you want it? top left? top right? bottom left?
i would think for best possible results on whereever you want it would be to use some "reverse" logic...document.write('<span id="logo" style="position:absolute;top:-300px;z-index:100">'+displayed+'</span>')
like ifyou wanted bottom left use
Code:position:absolute;bottom:0;left:0;z-index:100
Last edited by boogyman; 09-17-2007 at 08:09 PM.
i want to place it in a particular TD tag
so what do I change to the style?Position:relative?
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
Bookmarks