中的回调函数.脚本的移动()

Callback function in .Move() of scriptaculous

本文关键字:移动 函数 回调 脚本      更新时间:2023-09-26

我正在尝试这样的事情。

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

但它不起作用。哪里有问题??

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

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