Team:Uppsala/JavaScript

From 2014.igem.org

Revision as of 12:41, 16 July 2014 by Tjocko (Talk | contribs)

$(document).ready(function (){ var stats = $('.back-to-top'), timer;

       var offset = 220;

stats.hide();

$(function () { $(window).scroll(function() {

 if ((this).scrollTop() > offset) {
           stats.fadeIn();
           clearTimeout(timer);  

timer = setTimeout(function() { stats.stop(true,true).fadeOut('slow'); }, 3000);

   }

});

$('.back-to-top').click(function () { $('body,html').animate({ scrollTop: 0 }, 800); return false; }); }); });


jQuery(window).scroll(function() {
       if ((this).scrollTop() > offset) {
           ('.back-to-top').fadeIn(duration);       
   }