Weird Problem in IE During Imageswap--Screen Repainting

P

Phil Sandler

I am having a strange problem with IE 6 and an image swap.

I have a page with a dropdown list. The script changes an image on
screen based on the value selected in the list. Simple enough, right?

But when I change the value of the list by clicking with the mouse,
the screen repaints. It doesn't refresh from the server, it just sort
of "flashes".

1. If I change the list with the wheel on my mouse, the screen doesn't
repaint.
2. If I change the list with the keyboard down arrow, the screen
doesn't repaint.
3. However, if I OPEN the list with ALT-down arrow, then select by
hitting Return, it DOES repaint.
4. If I put an alert() in front of the swap, the screen doesn't
repaint.
5. If I wrap the call like this: "setTimeout("SwapImages('" + theKey +
"');",1)", the screen does not repaint.

#5 is my current solution, but I would like to understand why it's
happening before I move extraneous code into production.


Has anyone seen this problem before? I can post the code if
necessary.
 
G

Grant Wagner

Phil said:
I am having a strange problem with IE 6 and an image swap.

I have a page with a dropdown list. The script changes an image on
screen based on the value selected in the list. Simple enough, right?

But when I change the value of the list by clicking with the mouse,
the screen repaints. It doesn't refresh from the server, it just sort
of "flashes".

1. If I change the list with the wheel on my mouse, the screen doesn't
repaint.
2. If I change the list with the keyboard down arrow, the screen
doesn't repaint.
3. However, if I OPEN the list with ALT-down arrow, then select by
hitting Return, it DOES repaint.
4. If I put an alert() in front of the swap, the screen doesn't
repaint.
5. If I wrap the call like this: "setTimeout("SwapImages('" + theKey +
"');",1)", the screen does not repaint.

#5 is my current solution, but I would like to understand why it's
happening before I move extraneous code into production.

Has anyone seen this problem before? I can post the code if
necessary.

The onchange event doesn't fire until an item is actually selected, so it
won't fire when you simply cursor down the list of items, or if you scroll
with the wheel on your mouse and highlight an item. You have to actually
hit Enter in the first case, or click the item in the second.

Without seeing your code, it's impossible to say why it isn't working.
Either provide a URL to a site that demonstrates the problem (and the
steps needed to reproduce it) or provide the smallest snippet of code that
exhibits the problem.

List the browsers it does or doesn't work in, and what errors, if any, you
receive in browsers it does not work in.
 

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,020
Latest member
GenesisGai

Latest Threads

Top