Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(window).scroll(function() {
- if ($(this).scrollTop() > 300){
- $('.click-to-top').fadeIn(1000);
- } else {
- $('.click-to-top').fadeOut();
- }
- });
- $(".goTotop").click(function() {
- $("html, body").animate({scrollTop: 0}, 1000);
- });
- // html
- <div class="click-to-top">
- <a href="#body-wrapper" class="goTotop"><i class="fas fa-angle-double-up"></i></a>
- </div>
Add Comment
Please, Sign In to add comment