jquery拖动滑动切换页面选项卡效果代码
代码语言:html
所属分类:选项卡
代码描述:jquery拖动滑动切换页面选项卡效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<html>
<head>
<meta charset="UTF-8"><style>
* {
margin: 0;
padding: 0;
-moz-user-select: none;
/*火狐*/
-webkit-user-select: none;
/*webkit浏览器*/
-ms-user-select: none;
/*IE10*/
-khtml-user-select: none;
/*早期浏览器*/
user-select: none;
}
#box {
width: 350px;
height: 500px;
margin: 30px auto;
border-radius: 5px;
box-shadow: 0px 0px 27px -3px red;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-ms-border-radius: 5px;
-o-border-radius: 5px;
overflow: hidden;
position: relative;
background-color: #ccc;
}
.childbox {
width: 300%;
height: 100%;
display: flex;
position: absolute;
top: 0;
left: 0;
}
.childbox>div {
flex: 1;
height: 100%;
}
.child1 {
background-color: salmon;
}
.child2 {
background-color: greenyellow;
}
.child3 {
background-color: blueviolet;
}
.nav_box {
position: absolute;
width: 100%;
text-align: center;
line-height: 50px;
}
.nav_box div {
display: inline-block;
color: #fff;
margin: 0 5px;
position: relative;
}
.active_nav::before {
content: '';
position: absolute;
background-color: #fff;
left: 2px;
bottom: 7px;
width: 27px;
height: 2px;
}
.childbox>div {
position: relative;
}
.childbox>div .listview {
width: 100%;
position: absolute;
}
.view_child {
text-align: center;
line-height: 200px;
color: #fff;
font-size: 25px;
}
</style>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery.1.11.min.js"></script>
</head>
<body>
<div id="box">
<div class="childbox" style="left: -200%; transition: all 0.5s ease 0s;">
<div class="child1">
<div class="listview" type="附近">
<div class="view_child" style="background-color: rgb(38, 232, 246); height: 500px;">
<div>
附近:1
</div>
<hr>
<div>
页码:1
</div>
</div>
<div class="view_child" style="background-color: rgb(54, 89, 177); height: 500px;">
<div>
附近:2
</div>
<hr>
<div>
页码:1
</div>
</div>
<div class="view_child" style="background-color: rgb(39, 24, 52); height: 500px;">
<div>
附近:3
</div>
<hr>
<div>
页码:1
</div>
</div>
<div class="view_child" style="background-color: rgb(156, 123, 209); height: 500px;">
<div>
附近:4
</div>
<hr>
<div>
页码:1
</div>
</div>
<div class="view_child" style="background-color: rgb(146, 249, 134); height: 500px;">
<div>
附近:5
</div>
<hr>
<div>
页码:1
</div>
</div>
<div class="view_child" style="background-color: rgb(10, 203, 13); height: 500px;">
.........完整代码请登录后点击上方下载按钮下载查看
网友评论0