//HTML代码
<div class="container"> <div class="box1"> <img src="images/img1.jpg" alt=""> <img class="portrait" src="images/pic.jpg" alt=""> <div class="inner"> <h1>慕课网</h1> <p>慕课网,只学有用的</p> <span>查看课程</span> </div> </div> <div class="box2"> <span>×</span> <h1>慕课网</h1> <p>慕课网,只学有用的</p> <img src="images/img01.jpg" alt=""> <img src="images/img02.jpg" alt=""> <img src="images/img03.jpg" alt=""> <img src="images/img04.jpg" alt=""> </div> </div>
//JS代码
var container = $(".container"); var box1 = $(".box1"); var portrait = $(".portrait"); var open = $(".inner").find("span"); var box2 = $(".box2"); var close = box2.find("span"); var imgs = box2.find('img'); $.Velocity.RegisterUI('wangbin.slideUpIn',{ defaultDuration:500, calls:[ [{opacity:[1,0],translateY:[0,100]}] ] }); var seqInit = [ { elements:container, properties:'wangbin.slideUpIn', options:{ delay:300 } }, { elements:box1, properties:'wangbin.slideUpIn', options:{ sequenceQueue:false } }, { elements:portrait, properties:'wangbin.slideUpIn', options:{ sequenceQueue:false, delay:60 } } ]; $.Velocity.RunSequence(seqInit);
在html代码中没有插入javascript脚本吧