WPThemeCity.net

Premium WordPress Themes and Support

Tag Archives: script

  This function was given to me by Malinka, so all the credit and appreciation should be directed towards her… There are numerous plugins that add this functionality to websites, but if you wanted to have the “scroll to top” feature without a plugin follow the directions below: 1 – Place this Javascript code at the bottom of the script/script.js file: /* Back to top script */ jQuery(document).ready(function () { var offset = 200; var duration = 500; jQuery(window).scroll(function () { if (jQuery(this).scrollTop() > offset) { jQuery(‘.back-to-top’).fadeIn(duration); } else { jQuery(‘.back-to-top’).fadeOut(duration); } }); jQuery(‘.back-to-top’).click(function(event) { event.preventDefault(); jQuery(‘html, body’).animate({ scrollTop: 0 }, duration); return false; }); }); /* Back to top script end */   2 – Place the following in Continue Reading…