jquery-自定义不起作用
在我下面的脚本中,除了customEasing设置之外,一切都很好地工作,它似乎什么都不做。我打电话:jquery-自定义不起作用,jquery,animation,Jquery,Animation,在我下面的脚本中,除了customEasing设置之外,一切都很好地工作,它似乎什么都不做。我打电话: <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> …但我一辈子都搞不懂为什么定制设置没有
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
…但我一辈子都搞不懂为什么定制设置没有响应
谢谢
<script>
$(document).ready(function(){
$('#menu-home').fadeIn(function(){ $(this).animate({"left" : "-5px"}, {duration:1500, customEasing:{"left":"easeInExpo"}}); });
$('#menu-concerts').fadeIn(function(){ $(this).delay(150).animate({"left" : "-5px"}, {duration:1500, customEasing:{"left":"easeInElastic"}}); });
$('#menu-bio').fadeIn(function(){ $(this).delay(300).animate({"left" : "-5px"}, {duration:1500, customEasing:{"left":"easeInOutCubic"}}); });
$('#menu-contact').fadeIn(function(){ $(this).delay(1050).animate({"left" : "-5px"}, {duration:1500, customEasing:{"left":"easeInOutQuint"}}); });
});
</script>
$(文档).ready(函数(){
$(#menu home').fadeIn(function(){$(this).animate({“left”:“-5px”},{duration:1500,customEasing:{“left”:“easeinfo”});});
$(“#菜单音乐会”).fadeIn(function(){$(this).delay(150).animate({“left”:“-5px”},{duration:1500,customEasing:{“left”:“easeinastic”});});
$('#menu bio').fadeIn(function(){$(this).delay(300).动画({“left”:“-5px”},{持续时间:1500,自定义:{“left”:“easeInOutCubic”});});
$('#菜单联系人').fadeIn(function(){$(this).delay(1050).animate({“left”:“-5px”},{持续时间:1500,自定义:{“left”:“easeInOutQuint”});});
});
首先,你的语法是过度复杂的
试试这个:
$(document).ready(function(){
$('#menu-home').animate({
left : -5
}, 1500, "easeInExpo");
$('#menu-concerts').delay(150).animate({
left : -5
}, 1500, "easeInElastic");
$('#menu-bio').delay(300).animate({
left : -5
}, 1500, "easeInOutCubic");
});
重要强>
您需要在jquery之后包含jquery ui脚本。如果没有它,动画播放将无法工作。您可以提供JSFIDLE吗?你试过把持续时间作为fadeIn函数的第一个参数吗?我试过做一把小提琴(我以前从未做过),但似乎无法让它工作。。。尽管如此,相关代码仍在展示中:非常感谢您的帮助(以及您更好的代码)。