On Oct 26, 9:57 am, Jonathan <[EMAIL PROTECTED]> wrote:
> Is there any way to do two (or more) $('element').setStyle changes
> atomically? I'm trying to do a Tab control, where one <div> is hidden
> as another appears, but I occasionally get flickering when (for a
> split second) both <div> elements are visible simultaneously.
>
> My calls are:
> -- div1.setStyle({height: div2.getHeight()+'px'});
> -- div2.setStyle({height: 0});
I don't think you can expect a general library to support such a
specialised need. I takes a few moments to write your own (very
simple) function, something like:
function swapHeights(el1, el2) {
el1.setStyle(...);
el2.setStyle(...)
}
or maybe you'd like to extend Element.methods.
--
Rob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---