【问题标题】:Unknown Error - jQuery未知错误 - jQuery
【发布时间】:2016-02-07 12:55:12
【问题描述】:
$("document").ready(function(){
    $(this).css("position", "relative");
    $(this).click(function(){
        $("img").animate({top: 500}, 2000, "easeInQuad", function(alert("DONE!");){});
    });
 });

这段代码给了我错误Uncaught TypeError: jQuery.easing[this.easing] is not a function。我不知道发生了什么。

【问题讨论】:

  • $("document"). ==> $(document).
  • @Tushar 它不会改变任何东西。
  • 这看起来并没有改变任何东西,但确实如此。如果你在head 中包含了 JS,你就会知道。
  • function(alert("DONE!");){} 应该是function(){alert("DONE!");}

标签: javascript jquery web


【解决方案1】:

我发现两个错误。

1) 改变

$("document")

通过

$(document)

2) 属性是 jqueryui easeInQuad (https://jqueryui.com/easing/)。添加库 jqueryui

【讨论】:

    【解决方案2】:

    语法错误。应该是

    function() { alert("DONE!"); }
    

    【讨论】:

      猜你喜欢
      • 2013-08-12
      • 2010-09-15
      • 1970-01-01
      • 2017-08-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-18
      相关资源
      最近更新 更多