简体   繁体   English

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

[英]JQMIGRATE: easing function “jQuery.easing.swing” should use only first argument

I am upgrading my JQuery V1.9.1 to V3.0 and I am using the "jquery migrate 3.0".我正在将我的 JQuery V1.9.1 升级到 V3.0,并且我正在使用“jquery migrate 3.0”。 I have this warning in my Console :我的控制台中有此警告:

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

When I searched the source of the warning's message, I found this code :当我搜索警告消息的来源时,我发现了以下代码:

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

How can I rewrite this code to not get warning message?如何重写此代码以不收到警告消息?

I have found this link but I can't figure out How can I fix it?我找到了这个链接,但我不知道如何修复它?

I have the same warning for this code also :我对这段代码也有同样的警告:

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

For more information, you can see the console trace for second code:有关更多信息,您可以查看第二个代码的控制台跟踪:

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

Finally.最后。 I found the source of problem.我找到了问题的根源。

I was using jQuery Easing Plugin (version 1.3) when I got this error.出现此错误时,我正在使用jQuery Easing Plugin (version 1.3)

In this plugin we are using several function with multi parameters like : easeInQuad: function (x, t, b, c, d) {... And this was source of my problem.在这个插件中,我们使用了几个带有多参数的函数,例如: easeInQuad: function (x, t, b, c, d) {...这是我问题的根源。

I have deleted this plugin and I have no more this warning.我已经删除了这个插件,我再也没有这个警告了。

I believe that the issue here was that with jQuery 3 the extra parameters that the easing functions expected are now deprecated.我相信这里的问题是,在 jQuery 3 中,缓动函数所期望的额外参数现在已被弃用。 Read https://jquery.com/upgrade-guide/3.0/#deprecated-additional-easing-function-parameters for details.阅读https://jquery.com/upgrade-guide/3.0/#deprecated-additional-easing-function-parameters了解详情。

If you want to keep using the extra easing functions, visit https://github.com/gdsmith/jquery.easing and check out https://github.com/gdsmith/jquery.easing/blob/master/jquery.easing.js for the newer versions.如果您想继续使用额外的缓动功能,请访问https://github.com/gdsmith/jquery.easing并查看https://github.com/gdsmith/jquery.easing/blob/master/jquery.easing。 js用于较新的版本。

只需使用 jquery easing 1.4.1,因为这将解决您的问题https://github.com/gdsmith/jquery.easing

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM