sample code of scroll to top button. scroll to top without loading simple example. you can easaly implement in your project.

you can get code of scroll to top jquery snippet. we give you example of javascript scroll to top of page , you can simple copy bellow code and use in your project. If it free snippets of scroll to top bootstrap So you have to simple get those bellow code from tab of html, css and js. you simple click on HTML Code then you will get html code scroll to top button jquery snippets, click on JS Code tab get code of jquery codd for scroll to top button example snippets, same as for CSS Code tab. It's pretty easy and simple example of back to top button javascript snippet.


<!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> </head> <body> <button onclick="topFunction()" id="myBtn" title="Go to top">Top</button> <div style="background-color:#5DDDD3;color:white;padding:30px; border-bottom: 3px solid #43C3B9; position: fixed; width: 100%; top: 0px;"> <h1 style="margin: 0px;">Scroll Down</h1></div> <div style="background-color:#DAFEFE;padding:30px; height: 2500px; margin-top: 100px;">This example demonstrates how to create a "scroll to top" button that becomes visible when the user starts to scroll the page.</div> </body> </html>
#myBtn { display: none; position: fixed; bottom: 20px; right: 30px; z-index: 99; border: none; outline: none; background-color:#5DDDD3; color: white; cursor: pointer; height: 50px; width: 50px; border-radius:50%; font-weight: bold; } #myBtn:hover { background-color:#000; }
window.onscroll = function() {scrollFunction()}; function scrollFunction(){ if (document.body.scrollTop > 200 || document.documentElement.scrollTop > 200) { document.getElementById("myBtn").style.display = "block"; } else { document.getElementById("myBtn").style.display = "none"; } } function topFunction() { document.body.scrollTop = 0; document.documentElement.scrollTop = 0; }

Please Subscribe Your Email Address, We Will Notify You When Add New Snippet:





Random Post