Template:Team:KIT-Kyoto/Scroll
From 2014.igem.org
(Difference between revisions)
Line 9: | Line 9: | ||
return false; | return false; | ||
}); | }); | ||
- | var | + | var top = $('#page-top'); |
- | + | top.hide(); | |
$(window).scroll(function () { | $(window).scroll(function () { | ||
- | if ($(this).scrollTop() > 150) { | + | if ($(this).scrollTop() > 150) {top.fadeIn();} |
- | else { | + | else {top.fadeOut();} |
}); | }); | ||
- | + | top.click(function () { | |
$('body,html').animate({scrollTop: 0 }, 500, 'swing'); | $('body,html').animate({scrollTop: 0 }, 500, 'swing'); | ||
return false; | return false; |
Revision as of 20:27, 17 August 2014