Results 1 to 8 of 8

Thread: jumptop

  1. #1
    Join Date
    Dec 2005
    Posts
    133
    Thanks
    23
    Thanked 0 Times in 0 Posts

    Default jumptop

    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?

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    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:

    Code:
    window.scrollTo(0,0); return false;
    so it would look like this:

    Code:
    <a href="#top" onclick="window.scrollTo(0,0); return false;">Top</a>
    If the latter option, I'm not sure. Hope this helps nonetheless.
    "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

  3. #3
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    Code:
    <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

  4. #4
    Join Date
    Dec 2005
    Posts
    133
    Thanks
    23
    Thanked 0 Times in 0 Posts

    Default

    I still want the link to scroll down the page when the user scrolls

  5. #5
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    This line in the js file:

    Code:
    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.
    "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

  6. #6
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    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
    Code:
    position:absolute;bottom:0;left:0;z-index:100
    Last edited by boogyman; 09-17-2007 at 08:09 PM.

  7. #7
    Join Date
    Dec 2005
    Posts
    133
    Thanks
    23
    Thanked 0 Times in 0 Posts

    Default

    i want to place it in a particular TD tag
    so what do I change to the style?Position:relative?

  8. #8
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •