Connecting Tech Pros Worldwide Help | Site Map

Firefox flickers when adding an Option to Select element

  #1  
Old March 12th, 2008, 12:25 AM
Axel Gallus
Guest
 
Posts: n/a
I add some option items to a <selectbox by:

-----
MySelect.length = null; // clears all options in select element

for ( var i in Somename )

{

MySelect.options[MySelect.options.length] = new Option(Somename[i],
i,"True"); // appends new options

}

Firefox flickers when the items get added. IE doesn't.

Is there a way to avoid the flickering in firefox? This is anoying if you
update the select elemnt from times to times ajaxively.



Ragards

R4DIUM




  #2  
Old March 14th, 2008, 06:15 AM
tomtom.wozniak@gmail.com
Guest
 
Posts: n/a

re: Firefox flickers when adding an Option to Select element


On Mar 11, 6:19 pm, "Axel Gallus" <u...@rz.uni-karlsruhe.dewrote:
Quote:
I add some option items to a <selectbox by:
>
-----
MySelect.length = null; // clears all options in select element
>
for ( var i in Somename )
>
{
>
MySelect.options[MySelect.options.length] = new Option(Somename[i],
i,"True"); // appends new options
>
}
>
Firefox flickers when the items get added. IE doesn't.
>
Is there a way to avoid the flickering in firefox? This is anoying if you
update the select elemnt from times to times ajaxively.
>
Ragards
>
R4DIUM
I'll just throw out an idea (~hack) here.

Have you tried having two select boxes, one shown and one hidden?

1) Add an item to the hidden box.
2) Display hidden box (which should be on top of or behind the
previously shown one).
3) Hide the first box.
4) Add the same item to the now hidden box.

Of course, you'll need extra logic to know which one the user is
selecting from when submitting the form.

Just an idea.

Cheers,

-Tom Woz
Closed Thread