SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Hybrid View

  1. #1
    [Call me Bram] iBram007's Avatar
    Join Date
    Feb 2001
    Location
    Belgium
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Scrolling with page

    I'm sorry, but this is a script request... I didn't manage to find in on any other recource site...

    What I need is a javascript, that scrolls an image togheter with the page, so, the images is always visible. You can see an example on britannica.com , in the right bottom corner there's a little '+', that's scroll with the pages, well I want the same with a simple image.

  2. #2
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Though there are ways to do this with javascript, none that I've seen are truly 'fixed', but simply redrawn once the window stops scrolling.

    The only truly 'fixed' floating menu I've seen was done with CSS and can be seen here at the W3C site.
    It uses the position: fixed definition on a <DIV>.
    You can put the image into the DIV and it will be fixed just as you want it.

    No movement, no redraw, just fixed.

    It does exactly what it says on the tin!

    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  3. #3
    [Call me Bram] iBram007's Avatar
    Join Date
    Feb 2001
    Location
    Belgium
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want the image always visible, now the div is fixed, but if you scroll, the div disappears (IE6 @ winxp)...

  4. #4
    [Call me Bram] iBram007's Avatar
    Join Date
    Feb 2001
    Location
    Belgium
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found the solution: http://javascriptkit.com/javatutors/static3.shtml

    Thanks anyway.

  5. #5
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Odd, the W3C page is working perfectly for me.

    I'm on IE5.1 for Mac which is meant to be the most standards compliant combination available.
    Perhaps I'm seeing it correctly because of that.

    Do you have a url that I can visit to try it out with your image?
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  6. #6
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The javascript that you intend to use is not too great.
    It suffers from the same problems as all the other javascript solutions I have seen.

    Not only is the box-graphic not 'fixed' (it redraws, etc...), but it is buggy in a way that prevents the position where the box-graphic used to be from being redrawn and cleared.
    This means if I scroll the window and the position of the box *before* the scroll is still within the viewable area, it still has a copy of the box-graphic.
    That dead copy will stay there until something else draws over that area.
    This happens with each little step (even worse if I drag the scrollbar rather than use the scroll arrows).
    This means I end up with a stack of unrefreshed dead copies of the box-graphic.

    It may be a Mac thing, so if you aren't expecting/seeking Mac visitors it may not be worth even considering.

    That CSS method was the first version I've seen where it worked exactly right.

    Given that the CSS came from W3C you may want to consider it from a standards/forward-thinking perspective.
    Or maybe not.

    Just letting you know
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  7. #7
    [Call me Bram] iBram007's Avatar
    Join Date
    Feb 2001
    Location
    Belgium
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My site isn't online yet, but I'll let you know something.

    I don't expect I'll have a lot of Mac visitors (except you ), and I only use the script in some photo galleries and that's not the main purpose of my site


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
  •