在做的时候,看到一位博主的文章,才有些有些思路。页面滑动时可使用,只限在移动端哟~
这里是图片效果,代码写的不好,欢迎评论补充优化
<html class="has-bottombar">
<head>
<title>悬浮小球</title>
<meta name="full-screen" content="true">
<meta name="x5-fullscreen" content="true">
<meta name="360-fullscreen" content="true">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,maximum-scale=1.0, initial-scale=1.0, user-scalable=no">
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"> </script>
</head>
<style>
* { touch-action: pan-y; } /*这个要加哦,不然滑动的时候要报错哟~ */
.contents{
width: 100%;
height: 1200px;
}
.Login_entry{
pointer-events: all;
height: 60px;
width: 60px;
text-align: center;
position: fixed;
background-size: 100%;
bottom: 20%;
right: 7%;
z-index: 999;
background: brown;
border-radius: 50%;
}
.Login_entry .imgbtn{
height: 60px;
width: 60px;
display: block;
}
.ring.up{
opacity: 0;
display: none;
}
.ring.open{
opacity: 1;
}
.ring .menuItem{
display: block;
width: 50px;
height:50px;
position: absolute;
background: rosybrown;
border-radius: 50%;
}
.ring.in .menuItem{
opacity: 0;
z-index: -1;
}
/* 收缩 */
.ring.in .menuItem.zhanghao{
animation:bounceIndowned 0.5s, 0.5s ease;
-webkit-animation:bounceIndowned 0.5s, 0.5s ease;
}
.ring.in .menuItem.qq{
animation:bounceIndown2ed 0.5s, 0.5s ease;
-webkit-animation:bounceIndown2ed 0.5s, 0.5s ease;
}
.ring.in .menuItem.weixin{
animation:bounceIndown3ed 0.5s, 0.5s ease;
-webkit-animation:bounceIndown3ed 0.5s, 0.5s ease;
}
.ring.in .menuItem.weibo{
animation:bounceIndown4ed 0.5s, 0.5s ease;
-webkit-animation:bounceIndown4ed 0.5s, 0.5s ease;
}
.ring.in .menuItem.zhuce{
animation:bounceIndown5ed 0.5s, 0.5s ease;
-webkit-animation:bounceIndown5ed 0.5s, 0.5s ease;
}
/* 展开 */
.ring.open .menuItem.zhanghao{
animation:bounceIndown 0.5s, 0.5s ease;
-webkit-animation:bounceIndown 0.5s, 0.5s ease;
}
.ring.open .menuItem.qq{
animation:bounceIndown2 0.5s, 0.5s ease;
-webkit-animation:bounceIndown2 0.5s, 0.5s ease;
}
.ring.open .menuItem.weixin{
animat