"line create with scroll"
Bootstrap 4.1.1 Snippet by mdburhani52

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="upDiv"></div> <div> <div id="resizeMe"> </div> </div>
#resizeMe{ background-color: red; width: 10px; /*min-height: 100px;*/ margin-left: calc(50% - 5px); height: 0; } .upDiv{width: 100%; height: 500px; background-color: orange;} body{height: 1500px;}
$(document).ready(function() { var mainDiv = $('#resizeMe'); var windowHeight = $(window).height(); var topPos = $(window).scrollTop(); $(mainDiv).css('height', topPos + 'px'); var valueCookie=topPos; $(window).scroll(function(){ var topPos = $(this).scrollTop(); if (topPos > valueCookie){ console.log(valueCookie); valueCookie=topPos; $(mainDiv).css('height', topPos + 'px'); console.log(topPos); } }); });

Related: See More


Questions / Comments: