<div class=”box” data-scroll-speed=”5″>HTML</div>
<div class=”box” data-scroll-speed=”3″>CSS</div>
<div class=”box” data-scroll-speed=”7″>JAVASCRIPT</div>
<div class=”box” data-scroll-speed=”4″>JQUERY</div>
How to set Different Scroll time for each div :
<html >
<head>
<meta charset=”UTF-8″>
<title>jQuery different scroll speeds</title>
<style>
body {
font-family: arial, sans-serif;
}
.content {
height: 9000px;
}
.wrapper {
display: -webkit-box;
display: -moz-box;
display: box;
display: -webkit-flex;
display: -moz-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-moz-box-pack: center;
box-pack: center;
-webkit-justify-content: center;
-moz-justify-content: center;
-ms-justify-content: center;
-o-justify-content: center;
justify-content: center;
-ms-flex-pack: center;
-webkit-box-align: center;
-moz-box-align: center;
box-align: center;
-webkit-align-items: center;
-moz-align-items: center;
-ms-align-items: center;
-o-align-items: center;
align-items: center;
-ms-flex-align: center;
height: 100vh;
width: 100%;
position: fixed;
top: 0px;
left: 0px;
}
.box {
-webkit-box-flex: none;
-moz-box-flex: none;
box-flex: none;
-webkit-flex: none;
-moz-flex: none;
-ms-flex: none;
flex: none;
height: 150px;
width: 190px;
line-height: 150px;
text-align: center;
font-size: 25px;
color: #fff;
background: #ff8330;
margin:25px;
}
.box:nth-of-type(2) {
background: #E01B5D;
}
.box:nth-of-type(3) {
background: #179292;
}
.box:nth-of-type(4) {
background: #699817;
}
</style>
</head>
<body>
<div class=”content”>
<div class=”wrapper”>
<div class=”box” data-scroll-speed=”5″>HTML</div>
<div class=”box” data-scroll-speed=”3″>CSS</div>
<div class=”box” data-scroll-speed=”7″>JAVASCRIPT</div>
<div class=”box” data-scroll-speed=”4″>JQUERY</div>
</div>
</div>
<script src=’http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js’></script>
<script src=”js/index.js”></script>
</body>
</html>
