jQuery 效果 - animate() 方法
原文地址:http://www.w3school.com.cn/jquery/effect_animate.asp
经过实际检验,这个style的值,比如“height”貌似不能为百分比,最好是px
例如:
[pcsh lang=”js” tab_size=”4” message=”” hl_lines=”” provider=”manual”]
$("#shadow1").animate({height:"300px"},"slow"); // 可以通过
$("#shadow1").animate({height:"100%"},"slow"); // 不可以通过
[/pcsh]
实例
改变 "div" 元素的高度:$(".btn1").click(function(){
$("#box").animate({height:"300px"});
});
$(selector).animate(styles,speed,easing,callback) 参数为一个css
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Dev!