Beginners questions (scrollbars and more)

Discussion in 'Javascript' started by January Weiner, Aug 10, 2009.

  1. Hello all,

    I am fairly new to ECMAscript/Javascript. I am developing an app which
    allows the user to scroll an "infinite" image horizontally. The image is
    provided by a CGI script in chunks (say, PNGs of size 600x200 px). The
    whole image would have been way to large to load it in one go, not to
    mention the size of the associated imagemap.

    The whole point of involving ECMAscript for me is to get a smooth
    animation. This is how I do it: I load three images initially, but the one
    on the left and the one of the right are hidden by whitescreens (div
    elements with fixed position and background color set to white). The left
    one has negative position and is off the document page.

    When the image has to be scrolled -- say, to the left -- I call an
    animation function that slowly moves the images to the left. When the
    animation is done, I request (using XMLHttpRequest / Microsoft.XMLHTTP) the
    following (fourth image) and insert it into a fourth image slot (on the
    right). Then I kill the left-most slot.

    It all runs actually much better than I expected at first, but there is a
    small problem. At the bottom of the window there is a scrolling bar that
    changes its size / position during the operation. This is because of the
    rightmost whitescreen, covering the rightmost image slot (that just sits
    there and waits to be displayed).

    What can I do about it? Or maybe the whole approach is flawed?

    Cheers,
    j.
    January Weiner, Aug 10, 2009
    #1
    1. Advertising

  2. January Weiner meinte:

    > small problem. At the bottom of the window there is a scrolling bar that
    > changes its size / position during the operation. This is because of the
    > rightmost whitescreen, covering the rightmost image slot (that just sits
    > there and waits to be displayed).


    Apply overflow: hidden on an appropriate container. It's a CSS problem,
    not a JS issue.

    Gregor

    --
    http://www.gregorkofler.com
    http://web.gregorkofler.com - vxJS, a JS lib in progress
    Gregor Kofler, Aug 10, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Clemens Bosch

    Beginners questions for addition

    Clemens Bosch, Dec 2, 2004, in forum: VHDL
    Replies:
    0
    Views:
    556
    Clemens Bosch
    Dec 2, 2004
  2. bebonights
    Replies:
    0
    Views:
    353
    bebonights
    Oct 13, 2003
  3. Michael
    Replies:
    4
    Views:
    409
    Matt Hammond
    Jun 26, 2006
  4. Thomas
    Replies:
    11
    Views:
    607
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=
    Jul 11, 2007
  5. Robert Klemme

    With a Ruby Yell: more, more more!

    Robert Klemme, Sep 28, 2005, in forum: Ruby
    Replies:
    5
    Views:
    215
    Jeff Wood
    Sep 29, 2005
Loading...

Share This Page