JQMIGRATE:缓动函数 "jQuery.easing.swing" 应该只使用第一个参数

JQMIGRATE: easing function "jQuery.easing.swing" should use only first argument

我正在将 JQuery V1.9.1 升级到 V3.0,我正在使用 "jquery migrate 3.0"。 我的控制台中有此警告:

JQMIGRATE: easing function "jQuery.easing.swing" should use only first argument

当我搜索警告消息的来源时,我发现了这段代码:

$('#cleanTable').find("tbody").fadeIn(200, function() {
    $('#cleanTable').toggle();
    $('#cleanTable').toggle();
  });

如何重写此代码才能不收到警告消息?

我找到了 this link 但我不知道我该如何解决它?

我对这段代码也有同样的警告:

$("#" + p_divId).hide(0, function() { 
  $("#" + p_divId + 'Mask').remove();
  $("#" + p_divId).children().remove();
  ..........
}); // end .hide

有关更多信息,您可以查看第二个代码的控制台跟踪:

console.trace()
    migrateWarn @ jquery-migrate-3.0.0.js:64
    jQuery.Tween.run @ jquery-migrate-3.0.0.js:324
    tick @ jquery.js
    jQuery.fx.timer @ jquery.js
    Animation @ jquery.js
    doAnimation @ jquery.js
    dequeue @ jquery.js
    (anonymous function) @ jquery.js
    each @ jquery.js
    each @ jquery.js
    queue @ jquery.js
    animate @ jquery.js
    jQuery.fn.(anonymous function) @ jquery.js
    $.fn.extend.hide @ jquery.ui.js
    Hide0 @ (index):1663
    onclick @ (index):1647

终于。我找到了问题的根源。

出现此错误时我正在使用 jQuery Easing Plugin (version 1.3)

在这个插件中,我们使用了多个具有多个参数的函数,例如:easeInQuad: function (x, t, b, c, d) {...这就是我的问题的根源。

我已经删除了这个插件,我再也没有这个警告了。

我认为这里的问题是 jQuery 3 现在不推荐使用缓动函数预期的额外参数。阅读 https://jquery.com/upgrade-guide/3.0/#deprecated-additional-easing-function-parameters 了解详情。

如果您想继续使用额外的缓动函数,请访问 https://github.com/gdsmith/jquery.easing and check out https://github.com/gdsmith/jquery.easing/blob/master/jquery.easing.js 以获取较新的版本。

只需使用 jquery 缓和 1.4.1 即可解决您的问题 https://github.com/gdsmith/jquery.easing