Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
带slideUp缓解功能的jQuery缓解_Jquery_Slideup_Jquery Easing - Fatal编程技术网

带slideUp缓解功能的jQuery缓解

带slideUp缓解功能的jQuery缓解,jquery,slideup,jquery-easing,Jquery,Slideup,Jquery Easing,我刚读过这篇文章,但这个解决方案对我不起作用 这不起作用: $("#top_slide").slideUp(5000, "easeInOutQuart"); 但这确实有效: $("#top_container").animate({height: headerHeight}, 5000, "easeInOutQuart"); 我正在使用jQuery-1.10.2.js,这是最近的一个 有什么想法吗 // 我像这样添加了easing插件,它在JSFIDLE中工作: <script sr

我刚读过这篇文章,但这个解决方案对我不起作用

这不起作用:

 $("#top_slide").slideUp(5000, "easeInOutQuart");
但这确实有效:

$("#top_container").animate({height: headerHeight}, 5000, "easeInOutQuart");
我正在使用jQuery-1.10.2.js,这是最近的一个

有什么想法吗

//

我像这样添加了easing插件,它在JSFIDLE中工作:

<script src="js/jquery-1.10.2.js"></script>
<script src="js/jquery.easing.1.3.js"></script>
<script src="js/jquery.easing.compatibility.js"></script>
<script src="js/jquery.easing.min.js"></script>
我仍然得到这个错误:

Uncaught TypeError: Object #<Object> has no method 'easeInOutQuart'
rr.run jquery.js:9216
l jquery.js:8914
x.fx.timer jquery.js:9511
er jquery.js:8981
a jquery.js:9305
x.extend.dequeue jquery.js:3948
(anonymous function) jquery.js:3991
x.extend.each jquery.js:657
x.fn.x.each jquery.js:266
x.fn.extend.queue jquery.js:3984
x.fn.extend.animate jquery.js:9316
x.fn.(anonymous function) jquery.js:9442
(anonymous function) playingWithjQuery.php:38
c jquery.js:3048
p.fireWith jquery.js:3160
x.extend.ready jquery.js:433
q 
uncaughttypeerror:对象#没有方法“easeInOutQuart”
rr.runjquery.js:9216
jquery.js:8914
x、 fx.timer jquery.js:9511
erjquery.js:8981
jquery.js:9305
x、 extend.dequeue jquery.js:3948
(匿名函数)jquery.js:3991
x、 extend.each jquery.js:657
x、 fn.x.each jquery.js:266
x、 fn.extend.queue jquery.js:3984
x、 fn.extend.animate jquery.js:9316
x、 fn.(匿名函数)jquery.js:9442
(匿名函数)playingWithjQuery.php:38
jquery.js:3048
p、 fireithjquery.js:3160
x、 extend.ready jquery.js:433
Q
提前谢谢

//

我将其更改为一个div,这是我的html,这是:


$(函数(){
美元(“div”)。slideUp(5000美元,“easeInOutQuart”);
});

**此外,我使用的是本地主机服务器,而不是实际在线,即使我的本地服务器上有源文件,这会影响插件吗?

使用您可以使用的插件

$("#top_slide").slideUp({duration:5000, easing:"easeInOutQuart"});

JQuery只提供了一个标准的缓解功能,其他的都是其中的一部分。这包括easeInOutQuart

根据jQuery API,
.slideUp
调用应该如下所示:

 $("#top_slide").slideUp({ duration: 5000, easing: "easeInOutQuart" });
$("#top_slide").slideUp({ duration: 5000, easing: "easeInOutQuart" });
jsfiddle:

编辑-这个版本的html绝对有效



因此,使用一个有效的。这里有什么问题?可能是你的选择器吗?这是您正在使用它的两个不同元素。此外,您没有特别提到正在为jQuery加载easing库。如果你不这样做,那么你就不会得到你期望的结果。最后,宽松政策是否行不通?例如,在您的第一个代码段中,它是否会滑动,但不会滑动,或者什么?对于第一个添加了滑动的代码段,它将不再滑动。第二个问题并没有因为增加宽松政策而被打破。有可能因为我没有插件,第二个插件并没有真正放松,只是做了它通常做的事情。我们将在周一回到办公室时检查代码,看看什么是有效的!非常感谢。谢谢你把jsfiddle放上去,但它仍然不适合我。我在标题中加入了插件,但它仍然给出了错误:uncaughttypeerror:Object#没有方法'easeInOutQuart',这4个脚本标记中只有2个是必需的——第一个和最后一个。但是,不确定这是否会导致您的问题。您正在哪个浏览器中测试页面?我以前从未见过这样的例外!我使用的是Chrome,我在它不起作用的时候添加了更多插件,希望越多越好(虽然我知道它不是这样工作的)。你能发布更多的HTML文件吗?单页版本适合您吗?@livyjeffs在我的回答中看到edit,在jQuery之后需要导入easing脚本,并且只需要两个导入。在我的示例中,脚本localhost file://或cdn的宿主位置应该无关紧要。
$("#top_slide").slideUp({ duration: 5000, easing: "easeInOutQuart" });
<!DOCTYPE>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
  <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js></script>
</head>

<body>
<script>
    $(function() {
        $("div").slideUp(5000, "easeInOutQuart");

    });
</script>

  <div style="height: 300px; width: 300px; background: green;"></div> 
</body>
</html>