When we keep scrolling we will reach the end of divOne
at a particular time. At that time I want the divTwo
to be relative
(Initially it is fixed
). Here is my code. Please help
.divOne {
height: 800px;
width: 100%;
background-color: #000;
}
.divTwo {
height: 50px;
width: 100%;
position: fixed;
bottom: 0;
background-color: brown;
}
.divThree {
height: 100px;
width: 100%;
background-color: pink;
}
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<div class="divOne"></div>
<div class="divTwo"></div>
<div class="divThree"></div>