<button id="right">右移</button> <button id="stop">停止</button> <div class="box1"> php中文网</div> <script> $(document).ready(function(){ $('.but1').click(function(){ $('p').animate({fontSize:'40px'},1500)//属性名称font-size 一律改成驼峰写法:fontSize }) //同时操作多个css属性 //使用预定义的值 show hide toggle $('.but2').click(function(){ $('div').animate({ // left:'400px',//如果想对元素位置进行一个位移,那么我们需要给当前元素设置一个position例如: // opacity:'0.3', // height:'400px', // width:'400px' width:'toggle' },1500) }) $('#right').click(function(){ $('.box1').animate({left:'+500px'},3000) $('.box1').animate({fontSize:'30px'},500) }) $('#stop').click(function(){ $('.box1').stop(true) }) }) </script> 总结:animate使用前习惯性写上.stop(),立即完成动画,达到友好体验