On 12/9/05, Thomas Fuchs <[EMAIL PROTECTED]> wrote:
>
> Am 08.12.2005 um 08:49 schrieb Nicolas Terray:
> >
> > If I 'mouseover' the first select box, the second will be
> > highlighted. Great.
> > If I 'mouseover' and rapidly 'mouseout-mouseover' the first select box
> > whereas the effect is not finished, the second select box will be
> > freezed, i.e. the select box remains yellow and will not anymore
> > return to initial state.
> >
> > It is a bug ? a feature ?
> >
>
> Feature. The effects let you the choice of exactly when they should
> be run. If you're calling Effect.Highlight on an element that already
> has an Effect.Highlight going on, they will clash as they try to
> manipulate the same CSS styles.
>

To my mind, clash is not as positive as feature. ;)


> > Is there a workaround ?
>
> new Effect.Highlight('right',{queue:'end'});
>
> This will use the effect queuing feature of script.aculo.us to make
> sure that the Effect.Highlight calls will not clash and will be
> executed in order.
>

Thanks !
However it is not really the behaviour expected for the final user.
The element will be highlighted twice (or more) whereas the user has
just mouseover-out-over-... the element in less than half a second.
The effects will be queued and will last 2 seconds or more :(

I'm thinking about this solution :

1. when I want to highlight an element, I create a new
Effect.Highlight and attach this instance to the element :
--8<----
if (!el.highlighter) {
   el.highlighter = new Effect.Highlight(el);
}
--8<----

2. I check if there is already one running
--8<----
??? How can I check ???
--8<----

2. If yes I do nothing

3. if not I relaunch the effect
--8<----
??? I look at methods like render() but I don't find the solution  ???
--8<----

What do you think ? Is it possible ?

Nicolas Terray
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to