码迷,mamicode.com
首页 > Web开发 > 详细

jquery的一些笔记

时间:2018-04-24 11:01:31      阅读:192      评论:0      收藏:0      [点我收藏+]

标签:http   height   无法   动画   自定义   image   bubuko   ati   技术分享   

技术分享图片

show
hide
toggle

toggle能实现show 和hide的来回切换
toggle(中文翻译是切换)

=========================================
$("#b7").click(function(){
$("#d1").fadeTo("slow",0.2);
$("#d2").fadeTo("slow",0.5);
$("#d3").fadeTo("slow",0.8);
});

透明度

通过animate 可以实现更为丰富的动画效果
animate()第一个参数为css样式
animate()第二个参数为延时毫秒
注: 默认情况下,html中的元素都是固定,并且无法改变的位置的。 为了使用animate()自定义动画效果,需要通过css把元素的position设置为relative、absolute或者fixed。

 $("#b1").click(function(){
    div.animate({left:‘100px‘},2000);
    div.animate({left:‘0px‘,top:‘50px‘,height:‘50px‘},2000);
   });

===============
回调函数:
div.animate({left:‘0px‘,top:‘50px‘,height:‘50px‘},2000,function(){
alert("动画演示结束");
});

====================
技术分享图片

jquery的一些笔记

标签:http   height   无法   动画   自定义   image   bubuko   ati   技术分享   

原文地址:https://www.cnblogs.com/czy16/p/8926055.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!