Add files via upload
This commit is contained in:
parent
21b74c3630
commit
bcae72847d
20
100_projects/44-custom-range-slider/index.html
Normal file
20
100_projects/44-custom-range-slider/index.html
Normal file
@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<span id="rangeValue">0</span>
|
||||
<input class="range" type="range" name="" value="0"
|
||||
min="0" max="1000" onmousemove="range(this.value)"
|
||||
onchange="range(this.value)">
|
||||
</div>
|
||||
<script src="main.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
3
100_projects/44-custom-range-slider/main.js
Normal file
3
100_projects/44-custom-range-slider/main.js
Normal file
@ -0,0 +1,3 @@
|
||||
function range(value){
|
||||
document.getElementById('rangeValue').innerHTML = value;
|
||||
}
|
52
100_projects/44-custom-range-slider/style.css
Normal file
52
100_projects/44-custom-range-slider/style.css
Normal file
@ -0,0 +1,52 @@
|
||||
*{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
body{
|
||||
background: #8FBC8F;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
}
|
||||
div{
|
||||
position: relative;
|
||||
}
|
||||
#rangeValue{
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
right: -50px;
|
||||
background: #fff;
|
||||
text-align: center;
|
||||
width: 40px;
|
||||
padding: 2px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
#rangeValue::before{
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: -5px;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
transform: translateY(-50%) rotate(45deg);
|
||||
background: #fff;
|
||||
}
|
||||
.range{
|
||||
width:250px;
|
||||
height: 2px;
|
||||
background: #fff;
|
||||
outline: none;
|
||||
}
|
||||
.range::-webkit-slider-thumb,
|
||||
.range::-moz-slider-thumb{
|
||||
appearance: none;
|
||||
-moz-appearance: none;
|
||||
-webkit-appearance: none;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
background: #f00;
|
||||
color: #080;
|
||||
}
|
Loading…
Reference in New Issue
Block a user