PDA

View Full Version : SELECT jumps around when containing DIV shown


karaokeyoga
03-22-2006, 08:27 PM
Hi,

This is an IE-specific problem.

If I "display block" (via JavaScript) a DIV that contains a SELECT, the SELECT will sometimes be drawn in the wrong spot (i.e., be shifted vertically). This is a sporadic but quite reproducable problem.

Seems to be affected by the scrollbar or possibly other DIVs being shown/hidden (via "display", not "visiblity").

I have tried hacks such as attempting to nudge the position of the SELECT itself before/after revealing the containing DIV, but haven't come up with a consistent solution.

(In the application, I have two radio buttons... if you click the 2nd radio button, it will show a DIV that contains additional form elements such as SELECTs, etc.)

Ideas?

vwphillips
03-22-2006, 09:59 PM
try

display='';

inplace of display='block';
or even if nested in an element with style position

for 'none'
position='absolute';
visibility='hidden';

for 'block'
position='relative';
visibility='visible';

or post code example