js实现滑动滑块验证登录的方法
发布时间:2020-07-27 09:29:26
来源:亿速云
阅读:110
作者:小猪
这篇文章主要讲解了js实现滑动滑块验证登录的方法,内容清晰明了,对此有兴趣的小伙伴可以学习一下,相信大家阅读完之后会有帮助。
1.html代码
2.css样式
最大的盒子相对定位,其他内部内容绝对定位
需要根据层级设置z-index保证滑动的正常使用
.box{
position: relative;
width: 300px;
height: 34px;
background: #e8e8e8;
border-radius: 4px;
left: 20px;
}
.btn{
position: absolute;
top: 0;
width: 40px;
height:32px;
text-align: center;
line-height: 32px;
border-radius: 4px;
z-index: 3;
background-color: #