Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // scroll-to-top button functionality
- (function($) {
- $('body').append('<a href="#" title="Scroll to Top" class="scrollup">Scroll</a>');
- $(window).scroll(function() {
- if ($(this).scrollTop() > 300) {
- $('.scrollup').fadeIn(850);
- } else {
- $('.scrollup').fadeOut(850);
- }
- });
- $('.scrollup').click(function () {
- if (typeof window.SB !== 'undefined') {
- window.SB.scrollTo(0, 0, 800);
- } else {
- $("html, body").animate({
- scrollTop: 0
- }, 850);
- }
- return false;
- });
- })(jQuery);
Add Comment
Please, Sign In to add comment