"scroll top "
Bootstrap 4.0.0 Snippet by mdburhani52

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/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="first"> <button type="button" class="btn1">Click Me!</button> <button type="button" class="btn2">Click Me 2</button> </div> <div class="second">Hi</div> <div class="third">gfdsg</div>
.first { width: 100%; height: 1000px; background: #ccc; } .second { width: 100%; height: 1000px; background: #999; } .third { width: 100%; height: 1000px; background: #efefef; }
$(".btn1").click(function() { $('html,body').animate({ scrollTop: $(".second").offset().top}, 'slow'); }); $(".btn2").click(function() { $('html,body').animate({ scrollTop: $(".third").offset().top}, 'slow'); });

Related: See More


Questions / Comments: