On Jan 13, 12:12 pm, Marcos <marcos.justw...@gmail.com> wrote:
> Hello, considering that when I use the afterFinish call on the
> scriptaculous effects that are used on initial page load it works fine
> and the function is called indeed after the effect has finished
> rendering it's final loop.
>
> When i use the same afterFinish attribute on an effect that is called
> after a mouseover event, the function is called immediately (on the
> first frame). Is this a known bug? or am I missing something?
>
> mouseover: function(e) {
> var element = e.element();
> if (this.ready && (element.rel=='in' || element.rel==undefined))
> {
> new Effect.Highlight(element, { startcolor: '#111111',
> endcolor:
> '#BBBBBB', restorecolor: '#BBBBBB', duration: 0.5,queue: { position:
> 'end', scope: element.id + '_hl', limit: 2}});
> new Effect.Move(element,{ x: -30, y: 0, mode: 'relative',
> transition: Effect.Transitions.spring, duration: 0.6, queue:
> { position: 'end', scope: element.id + '_mv', limit: 2}, afterFinish:
> this.mouseover_finished(element)});
> }
>
> },
You are calling this.mouseover_finished(element) and passing the
result as the value of 'afterFinish'.
You need to pass a function, not a function call. Either an anonymous
function(element) {this.mouseover_finished(element)}
or I suspect this will work
afterFinish: mouseover_finished.bind(this)
though I haven't followed through the meanings of the various 'this'
tokens to be sure.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---