Callback function in .Move() of scriptaculous

46 Views Asked by At

I am trying to something like this.

new Effect.Move('moveee', { x: -150}, { afterFinish: function () { console.log(x); } });

But it is not working. Where is the wrong ??

1

There are 1 best solutions below

0
jeffjenx On BEST ANSWER

The Effect.Move function accepts two parameters. You are passing in three. You need to move the afterFinish property and value to the second parameter, like so:

new Effect.Move(
  'moveee', 
  {
    x: -150,
    afterFinish: function ()
    {
      console.log(x);
    }
  }
);