Beginners questions (scrollbars and more)

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.
 
G

Gregor Kofler

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top