Wed, July 6, 2022
https://devcodepro.comdevcodepro
Home · Latest · Trends
1

jQuery - Scroll to the top of the page button

Scroll to the top of the page button with jQuery
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Untitled</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" />
    <style>
        body,html{
        height: 200%;
        }
        #gototop{
        display: none;
        font-size: 38px;
        background: rgba(97, 123, 199, 0.72);
        position: fixed;
        bottom: 50px;
        right: 50px;
        width: 70px;
        height: 70px;
        line-height: 60px;
        text-align: center;
        color: #fff;
        cursor:pointer;
    }
    </style>
</head>
<body>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
    <a id="gototop"><i class="fa fa-chevron-up"></i></a>
    <script>
        $(window).scroll(function() {
          var offset = $("body").offset().top + 600;
          if ($(window).scrollTop() >= offset) {
              $("#gototop").show("slow");
              }else{
              $("#gototop").hide("slow");
           }
        });
        $("#gototop").click(function(){
                  $('html, body').animate({ scrollTop: 0 }, 'slow');
        });
    </script>
</body>
</html>
AD ยท www.interserver.net/r/240055 

Interserver | Standard & VPS Cloud Hosting | $2.50 /Month

Flexible VPS hosting platform to deploy your online projects. Economical and balanced between processor cores, memory and storage
rated 1 times (1) (0)
comments: 0 / hits: 1735  / 5 years ago, wed, aug 30, 17, 05:56:41
More From » HTML, XML
 

Comments

There are no comments for this Snippet yet
Only authorized users can post. Please sign in first, or register a free account
Login with Google
 
Share
Posted
bigjoe
Member since Aug 6, 2017
Total Code Snippets: 5
Total Comments: 0
Location: n/a
bigjoe snippets
5 years ago, sun, aug 6, 17, 5:31:35
UPDATE `users` SET `lastdate`='2017-01-01 00:00:00'; ALTER TABLE `users` CHANGE `lastdate` `lastdate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
comments: 0 / hits: 2978
SQL
5 years ago, sun, aug 6, 17, 5:14:06
SELECT *, COUNT(reviewid) AS counter FROM article LEFT JOIN reviews on article.id = reviews.articleid GROUP BY article.id, reviews.articleid ORDER BY article.id DESC LIMIT 12;
comments: 0 / hits: 3523
SQL
5 years ago, tue, aug 22, 17, 7:46:43
tinymce.init({ selector: 'textarea', height: 350, content_style: ".mce-content-body {font-size:13px;color: #607d8b;font-family:tahoma,verdana}", menubar: false, plugins: [ 'advlist autolink lists link image charmap print preview anchor', 'searchreplace visualblocks code fullscreen', 'insertdatetime media table contextmenu paste code' ], toolbar: 'undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image' });
comments: 0 / hits: 2043
5 years ago, tue, aug 22, 17, 6:12:46
.tooltip-inner { background-color: #5589b3; border-radius: .15rem; } .tooltip.bs-tether-element-attached-bottom .tooltip-inner::before, .tooltip.tooltip-top .tooltip-inner::before { border-top-color: #5589b3; }
comments: 1 / hits: 7557
CSS