My question, I guess, is whether there's a way to make multiple calls
to setStyle before any of them take effect. Essentially, I want the
next browser update to have the results of both changes. I do not want
to permit the browser to update in between (after the first but before
the second).

I'm not looking for something specific to my needs, for setting the
Height specifically. I'm just wondering if there's any way to solve
this general problem.

On Oct 26, 5:07 am, RobG <[EMAIL PROTECTED]> wrote:
> 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to