It seems that effect.cancel(); this.cancel(); , etc. don't have an effect. I may look @ a different workaround / better queue system -- as I never want an active element (current element -- set via a onMouseOver) to become folded up -- and while rolling the mouse over several elements at once, and then stopping at one, it seems to roll it up (probably by a BlindUp effect in the queue stack) , and further -- sometimes the Blinded Up <div> never re-appears (even after waiting out all queued effects). If anyone would like, I could send the entire source .. although am going to sleep on this one for now ;)

Thanks for the tips.

~ Brice

Nicholas Schlueter wrote:
I believe he is getting element from the original toggleText function
parameter, but I really don't know.  I was just fixing the "this"
problem.

On 5/22/06, Gregory Hill <[EMAIL PROTECTED]> wrote:
Wouldn't you need to do effect.element?  Just element by itself probably
is not referring to what you think it is.

Greg

> -----Original Message-----
> From: [EMAIL PROTECTED]
[mailto:rails-spinoffs-
> [EMAIL PROTECTED] On Behalf Of Nicholas Schlueter
> Sent: Monday, May 22, 2006 4:33 PM
> To: [email protected]
> Subject: Re: [Rails-spinoffs] Canceling a specific effect
>
> I haven't tested this, but I believe the beforeStart function takes a
> parameter of the effect.
>
> So your beforeStart function should look like:
> beforeStart: function(effect) {
>     if (menu.currentHeader == element) {
>         effect.cancel();
>     }
> }
>
> hope this helps
> Nicholas
>
> On 5/22/06, Brice Burgess <[EMAIL PROTECTED]> wrote:
> > Is there a way to cancel a specific effect? For instance; Effects
are
> > added to the queue. Before actually processing the effect, I'd like
to
> > check a condition & cancel the effect if necessary.
> >
> > Here's the code excerpt:
> > var menu = {
> >     toggleText: function(element,toggle) {
> >         var vis = $(element+'Text').visible();
> >         if (toggle && !vis) { // toggle text ON
> >             new Effect.BlindDown(element+'Text', {queue: {scope:
> > 'headers', position:'front'}});
> >         }
> >         else if (!toggle && vis && this.currentHeader != element) {
> >             new Effect.BlindUp(
> >                 element+'Text',
> >                 {
> >                     queue: {scope: 'headers', position:'end'},
> >                     beforeStart: function() {
> >                         if (menu.currentHeader == element) {
> >                             this.cancel();
> >                         }
> >                 }
> >             });
> >         }
> >     },
> >
> >     I'm not sure that this.cancel(); cancels the effect, nor that
the
> > comparisson (currentHeader == element) remains static to the
original
> > element the Effect was called for.
> >
> > Any ideas?
> >
> > Thanks,
> >
> > ~ Brice Burgess
> >
> > _______________________________________________
> > Rails-spinoffs mailing list
> > [email protected]
> > http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
> >
>
>
> --
> DCRails.com || Making the Metrorail fun!
> _______________________________________________
> Rails-spinoffs mailing list
> [email protected]
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs




_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to