"Back to top"
Bootstrap 4.1.1 Snippet by psomankar11

<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="container"> <div class="row"> <div id="BackToTop" style="">></div> </div> </div>
/*************************back to top****************************/ div#BackToTop { position: fixed; right: 10px; bottom: 10px; height: 40px; width: 40px; text-align: center; line-height: 40px; font-size: 20px; background:#40979f; border-radius: 50px; color: #fff; cursor: pointer; } a{ text-decoration: none !important; } /*************************back to top****************************/
$(window).scroll(function () { if ($(this).scrollTop()) { $('#BackToTop').fadeIn(); } else { $('#BackToTop').fadeOut(); } }); $("#BackToTop").click(function () { $("html, body").animate({ scrollTop: 0 }, 1000); });

Related: See More


Questions / Comments: