(function($){ /* $('#div1').velocity({ width:'300px' },{ duration:1000, complete:function(){ $('#div2').velocity({ width:'300px' },{ duration:1000, }); } });*/ var seq = [ { elements: $('#div1'), properties:{width:'300px'}, options:{duration:1000} }, { elements: $('#div2'), properties:{width:'300px'}, options:{duration:1000} }, { elements: $('#div3'), properties:{width:'300px'}, options:{duration:1000} } ]; $.Veloctiy.RunSequence(seq); })(jQuery);
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <link rel="stylesheet" href="css/style.css"> <title>velocity.js练习</title> <script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript" src="js/velocity.min.js"></script> <script type="text/javascript" src="js/velocity.ui.min.js"></script> </head> <body> <div id="div1"></div> <div id="div2"></div> <div id="div3"></div> <script type="text/javascript" src="js/script.js"></script> </body> </html>
fanfanCode
m慕光