scriptaculous的.Move()中的回调函数

时间:2016-07-06 23:46:37

标签: javascript callback effect scriptaculous

我正在尝试这样的事情。

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

但它不起作用。哪里错了?

1 个答案:

答案 0 :(得分:1)

Effect.Move函数接受两个参数。你要过三个人。您需要将afterFinish属性和值移动到第二个参数,如下所示:

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