Results 1 to 4 of 4

Thread: Changing 'jump to top' script so it sits left side of screen

  1. #1
    Join Date
    Jun 2008
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Changing 'jump to top' script so it sits left side of screen

    Hi

    Does anyone know how to change the 'jump to top' script so it sits on left side of screen not the right side?

    http://www.dynamicdrive.com/dynamicindex5/jumptop.htm

    Thanks

    - K

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Here in the script:

    Code:
    function inserttext(){ //function for IE4/ NS6
    if (ie4)
    crosslogo=document.all.logo
    else if (ns6)
    crosslogo=document.getElementById("logo")
    crosslogo.innerHTML='<a href="'+logolink+'">'+displayed+'</a>'
    w=ns6 || window.opera? window.innerWidth-crosslogo.offsetWidth-20 : ietruebody().clientWidth-crosslogo.offsetWidth-10
    h=ns6 || window.opera? window.innerHeight-crosslogo.offsetHeight-15 : ietruebody().clientHeight-crosslogo.offsetHeight-10
    crosslogo.style.left=w+"px"
    crosslogo.style.top=h+"px"
    if (ie4)
    window.onscroll=staticit
    else if (ns6)
    startstatic=setInterval("staticit()",100)
    }
    Change the highlighted line to whatever value you like, ex:

    w=25;

    That would make the position 25 pixels from the left of the window. No calculation is required for positioning this on or near the left side of the window because the width of the window (what all that math is for) is irrelevant.

    This value will also be used later in the script to calculate where to position the link should the window be scrolled horizontally, thus keeping it in view at the position you've designated.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    k_mailbx (06-23-2008)

  4. #3
    Join Date
    Jun 2008
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thank you - works a treat!

    One further question - if I want the current blue link to be black how would I go about that? its picking up turning white when I hover over it - as per my settings for other links.

    - K

  5. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The link is inside of a span with the id of 'logo'. So, you may specify some or all of these for it in your stylesheet:

    Code:
    #logo a:link {
    color:black;
    }
    #logo a:visited {
    color:black;
    }
    #logo a:hover {
    color:black;
    }
    #logo a:active {
    color:black;
    }
    You don't need to use the same color for all of them, that's up to you. Other style property/value pairs may be used. Not all pairs will have exactly the effect you might imagine, as the script requires certain things to function, so in some few cases, your choices will either be overridden by the script or mess up the script. You will generally know if and when either of those two things happen. But if you have a question about a particular style that isn't working out for you, let us know.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •