// JavaScript Document
(function($){
/*$("#div1").velocity({
width:'300px'
},{
duration:1000,
complete:function(){
$("#div2").velocity({
width:'300px'
},{
duration:1000,
complete:function(){
$("#div3").velocity({
width:'300px'
},{
duration:1000
});
}
});
}
});*/
//之后可执行多个动画
var seq = [
{
elements:$("#div1"),//执行动画的元素
propreties:{width:'300px'},//动画效果
options:{duration:1000}//velocity选项
},
{
elements:$("#div2"),
propreties:{width:'300px'},
options:{duration:1000}
},
{
elements:$("#div3"),
propreties:{width:'300px'},
options:{duration:1000}
}
];
$.Velocity.RunSequence(seq);
})(jQuery);
下面html文件代码
<!DOCTYPE htm>
<head>
<meta http-equiv="Content-Type" charset="utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="js/jquery.js"/></script>
<script type="text/javascript" src="js/velocity.min.js"/></script>
<script type="text/javascript" src="js/velocity.ui.min.js"/></script>
<title>无标题文档</title>
</head>
<body>
<div id="div1" class="box"></div>
<div id="div2" class="box"></div>
<div id="div3" class="box"></div>
<script type="text/javascript" src="js/script.js"/></script>
</body>
图片上的是错误提示
原来是单词拼错了,,
document html
<script></script>
注意一下标签的闭合