D
dave8421
Hi,
I'm creating some animation code called on a timer, and depending on
the state I will either hide or show an item.
e.g. I might need to set something like
someElement.style.display = "block"
However, if the style is already set to "block", then is there
potential for the browser to cause flickering or do extra work if
setting the style to "block" when it is done already.
perhaps it is safer to do
if( someElement.style.display != "block" ) {
someElement.style.display = "block";
}
.... but i just don't like adding unnecessary code
I'm creating some animation code called on a timer, and depending on
the state I will either hide or show an item.
e.g. I might need to set something like
someElement.style.display = "block"
However, if the style is already set to "block", then is there
potential for the browser to cause flickering or do extra work if
setting the style to "block" when it is done already.
perhaps it is safer to do
if( someElement.style.display != "block" ) {
someElement.style.display = "block";
}
.... but i just don't like adding unnecessary code