PHP Classes

File: public/js/back-to-top.js

Recommend this page to a friend!
  Classes of Joko Prasetyo   WP Back to top button   public/js/back-to-top.js   Download  
File: public/js/back-to-top.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: WP Back to top button
Insert a back to the top button in posts' footer
Author: By
Last change:
Date: 15 days ago
Size: 465 bytes
 

Contents

Class file image Download
jQuery(document).ready(function($) { var offset = 100, speed = 250, duration = 500, scrollButton = $("#topbutton"); $(window).scroll(function() { if ($(this).scrollTop() < offset) { scrollButton.fadeOut(duration); } else { scrollButton.fadeIn(duration); } }); scrollButton.on("click", function(e) { e.preventDefault(); $("html, body").animate( { scrollTop: 0 }, speed ); }); });