jquery的动效及才知道的方法

2018-05-09  本文已影响0人  从前慢pearl

1,下拉效果

1, 元素.hover(fn1(){},fn2(){})   //fn1 鼠标移入调用   fn2 鼠标离开调用
2, 元素.stop()   //停止目前的动画
3, 元素.slideDown()     元素.slideUp()     向上向下滑动

代码

2,隐藏显示

图片.png

3,淡入淡出

图片.png

4,animate()自定义动画

图片.png

5,获取鼠标的位置

$(document).mousemove(function(e){
    $("span").text('x:'+e.pageX+',Y'+e.pageY);   
})

代码

6,移动端的滑动事件

水平向左滑动: swipeleft
水平向右滑动: swiperight


图片.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 :速度
上一篇 下一篇

猜你喜欢

热点阅读