读书人

动画片效果

发布时间: 2012-11-05 09:35:12 作者: rapoo

动画效果
初始化:

<button>开始一连串动画</button> <button>stop()</button> <button>stop(true)</button> <button>stop(false,true)</button> <button>stop(true,true)</button><div id="panel">    <h5 name="code">$(function(){      $("button:eq(0)").click(function () {          $("#panel")            .animate({height : "150" } , 1000 )            .animate({width : "300" } , 1000 )            .hide(2000)            .animate({height : "show" , width : "show" , opacity : "show" } , 1000 )            .animate({height : "500"} , 1000 );      });      $("button:eq(1)").click(function () {          $("#panel").stop();//停止当前动画,继续下一个动画      });      $("button:eq(2)").click(function () {          $("#panel").stop(true);//清除元素的所有动画      });      $("button:eq(3)").click(function () {          $("#panel").stop(false,true);//让当前动画直接到达末状态 ,继续下一个动画      });      $("button:eq(4)").click(function () {          $("#panel").stop(true,true);//清除元素的所有动画,让当前动画直接到达末状态      });})

读书人网 >Web前端

热点推荐