SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict djh's Avatar
    Join Date
    Apr 2000
    Location
    Long Beach, CA
    Posts
    333
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Need some help. Pretty simple I think.

    I have a vertically long page. So, I want a graphic to stay in the same relative position on the page (top right)
    no matter how far down one scrolls.

    I know it's possible cuz I've seen it done before. Any suggestions?

    Drink on George W.

  2. #2
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You will find scripts that do this at both http://www.dynamicdrive.com and http://www.bratta.com/. I personally think Bratta's scripts are the better written ones but they are harder to customize than Dynamic Drive's are.
    Wayne Luke
    ------------


  3. #3
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Dave,

    You probably should have posted this in the client-side forum. At any rate:

    Perhaps the following example will be of help:

    function initScroll()
    {
    layerDom.top = eval(ie ? document.body.scrollTop : window.pageYOffset);
    layerDom.left = eval(ie ? document.body.scrollLeft : window.pageXOffset);
    setTimeout("initScroll()", 30);
    }
    Essentially, you have to constantly reset the layer's positioning (top and/or left) by using javascript's timeOut method. The 'layerDom' above is an object that references the layer's document object model (for example: IE, document.all.layerID.style; NN: document.layers.layerID). Note that IE uses "scroll..." and NN uses "page...Offset". The "30" is simply a time interval. The function needs to be initiated either with the onLoad event handler or at the end of the head tag's script declarations.

    FinalNote = (Hope this helps.) ? let me know. : have fun

    Vinny

    Where the World Once Stood
    the blades of grass
    cut me still

  4. #4
    Kat's Meow Senior ******* WebKat's Avatar
    Join Date
    Jul 1999
    Location
    California USA
    Posts
    1,071
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <<< ~Dave~ Your post was moved from Web Page Design to Client Side Scripting Forum...WebKat, Senior Advisor >>>

    ~ Be sure to let us know if Vincent's script has worked! ~
    Dlynn :: SitePoint Senior Advisor ::
    PawPrint Designs by WebKat
    "Dogs come when they're called; Cats take a message and get back to you later." ~ Mary Bly

  5. #5
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    WebKat: If you're listening

    It's not really a script, but a direction.

    Vinny
    Where the World Once Stood
    the blades of grass
    cut me still

  6. #6
    Kat's Meow Senior ******* WebKat's Avatar
    Join Date
    Jul 1999
    Location
    California USA
    Posts
    1,071
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Whoops ~ Thanks Vinny for the distinction ~ had too many scripts on my mind that day...
    Dlynn :: SitePoint Senior Advisor ::
    PawPrint Designs by WebKat
    "Dogs come when they're called; Cats take a message and get back to you later." ~ Mary Bly


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
  •