jQuery元素动画animate()用法

jQuery元素动画animate()用法

<button>www.96net.com.cn</button>

1,基本用法

$("button").click(function(){ $("div").animate({left:'250px'}); });

2, animate() - 操作多个属性

$("button").click(function(){ $("div").animate({ left:'250px', opacity:'0.5', height:'150px', width:'150px' }); });

3,animate() - 使用预定义的值

$("button").click(function(){ $("div").animate({ height:'toggle' }); });

4,animate() - 使用队列功能

$("button").click(function(){vardiv=$("div"); div.animate({height:'300px',opacity:'0.4'},"slow"); div.animate({width:'300px',opacity:'0.8'},"slow"); div.animate({height:'100px',opacity:'0.4'},"slow"); div.animate({width:'100px',opacity:'0.8'},"slow"); });

animate() - 使用队列功能

猜你喜欢

转载自www.cnblogs.com/96net/p/12586086.html
今日推荐