J
January Weiner
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.
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.