jquery的动效及才知道的方法
2018-05-09 本文已影响0人
从前慢pearl
1,下拉效果
1, 元素.hover(fn1(){},fn2(){}) //fn1 鼠标移入调用 fn2 鼠标离开调用
2, 元素.stop() //停止目前的动画
3, 元素.slideDown() 元素.slideUp() 向上向下滑动
2,隐藏显示
![](https://img.haomeiwen.com/i4145758/9590dabf509c755d.png)
3,淡入淡出
![](https://img.haomeiwen.com/i4145758/bc612c8f419ebedd.png)
4,animate()自定义动画
![](https://img.haomeiwen.com/i4145758/0d87c719276e2de6.png)
5,获取鼠标的位置
$(document).mousemove(function(e){
$("span").text('x:'+e.pageX+',Y'+e.pageY);
})
6,移动端的滑动事件
水平向左滑动: swipeleft
水平向右滑动: swiperight
![](https://img.haomeiwen.com/i4145758/a18423b8cd8d40d1.png)
7,悬浮遮罩
元素.hover(function () {
$(this).find('.games_a_box_pop').stop().animate({left: 0}, {duration: "normal"})
}, function () {
$(this).find('.games_a_box_pop').stop().animate({left: -380}, {duration: "normal"})
}) // duration :速度