jqery实现一个图标上下滑动效果

Posted 不再犯错

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jqery实现一个图标上下滑动效果相关的知识,希望对你有一定的参考价值。

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<style type="text/css">
.contain-foot-nav {
width: 33.3%;
float: left;
text-align: center;
position: relative;
}

.contain-foot-nav img {
display: block;
margin: 0 auto;
}

.foot-nav-top {
width: 100%;
height: 120px;
position: absolute;
}
.contain-foot-nav h2{
margin-top: 120px;
}
.contain-foot-nav h3 {
font-size: 16px;
color: #4CD1A2;
}

</style>
<body>
<div class="contain-foot-nav">
<div class="foot-nav-top">
<a href="tel://020-38353308"><img src="img/location.jpg"/></a>
</div>
<h2>联系电话</h2>
<h3>020-38353308</h3>
</div>
<script src="js/jquery-1.9.1.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
$(function(){
var set = setInterval(function() {
top();
bottom();       //启动计时器
}, 1500);
top();
bottom();

function top() {
$(".foot-nav-top").animate({
top: "15px"
});
};

function bottom() {
$(".foot-nav-top").animate({
top: "1px"
});
};
$(".foot-nav-top").mouseenter(function() {
clearInterval(set);     //清除计时器
})
$(".foot-nav-top").mouseleave(function() {
set = setInterval(function() {    //启动计时器
top();
bottom();
}, 1500);
})

});
</script>
</body>
</html>

以上是关于jqery实现一个图标上下滑动效果的主要内容,如果未能解决你的问题,请参考以下文章

Android实现布局顶部底部上下滑动效果

Android实现布局顶部底部上下滑动效果

android Launcher的滑动效果怎么实现?

基于vue实现上下滑动翻页效果

ios微信小程序上下滑动效果

iOS ~ UICollectionView 横向分页滑动,cell左右横向排列