I like this.  Thanks.
 = Dash =

On Mar 21, 1:02 pm, kangax <[EMAIL PROTECTED]> wrote:
> How about some #wrap magic?
>
> ...
> Element.Methods.positionedOffset =
> Element.Methods.positionedOffset.wrap(function(proceed, element) {
>   element = $(element);
>   if (element.visible()) return proceed(element);
>   element.setStyle({ visibility: 'hidden' }).show();
>   var result = proceed(element);
>   element.hide().setStyle({ visibility: 'visible' });
>   return result;
>
> })
>
> Element.addMethods();
> ...
>
> This simply encapsulates all of the "switching" into the
> #positionedOffset method itself.
>
> Best,
> kangax
>
> On Mar 21, 12:18 pm, dashifen <[EMAIL PROTECTED]> wrote:
>
> > I came up with my own better way to avoid flickering of the element:
>
> > 1.  Make the element completely transparent (element.setOpacity(0))
> > 2.  Show it (element.show())
> > 3.  Get its position (element.positionedOffset())
> > 4.  Hide it (element.hide())
> > 5.  Make it opaque again (element.setOpacity(1))
>
> > Still a little ugly, though.
--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-spinoffs@googlegroups.com
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