Charlie, you're adding options to a select element and then attempting to
get its width immediately, right? And when you do this the width in IE is
not correct, right?
A quick test would be to add a click event to your page that alerts the
width of the select element. I bet this will return the
setTimeout( function(){ alert( $(#select-thing).width() ) }, 0 );
That did the trick! Behavior is now identical in Firefox and IE6, and
in both cases the width correct. Oddly, it continues to update with
the new width even if I move the setTimeout line to before the New
option call. I'm
The quirk is to be expected. From what I understand of timeouts, they will
never fire at 0ms... but setting a timeout to 0ms guarantees it will fire at
the next possible time and put it at the end of the call stack... and,
thankfully, in this case allows the user interface to catch up. Anyhow, I'm
3 matches
Mail list logo