鼠标滑上去之后元素上移效果js

来源:互联网 发布:docker安装mysql详解 编辑:程序博客网 时间:2024/06/05 07:56

鼠标滑上去的时候阻止事件冒泡,然后做个修改顶部距离的延迟动画


$(function(){$(".floating").hover(function(){$(this).stop().animate({bottom:49},500);},function(){$(this).stop().animate({bottom:0},500);})})

css重点:


.ourservice_m {
    height:375px;
    overflow:hidden;
    position:relative;
}

.floating {
    bottom:0;
    position:absolute;
}

原创粉丝点击