Difference between revisions of "Team:Brasil-USP/Templates/Foot"
Thmosqueiro (Talk | contribs) |
Thmosqueiro (Talk | contribs) |
||
Line 3: | Line 3: | ||
<div class="container"> | <div class="container"> | ||
<footer> | <footer> | ||
− | |||
<p>© 2015 Brasil-USP Team | <p>© 2015 Brasil-USP Team | ||
· <a href="https://2015.igem.org/">iGEM</a> | · <a href="https://2015.igem.org/">iGEM</a> | ||
Line 10: | Line 9: | ||
</footer> | </footer> | ||
</div> | </div> | ||
− | < | + | <a class".back-to-top" href="#top">Back to top</a> |
− | + | ||
<!-- Bootstrap core JavaScript | <!-- Bootstrap core JavaScript | ||
================================================== --> | ================================================== --> | ||
Line 43: | Line 42: | ||
} | } | ||
}); | }); | ||
+ | |||
+ | var offset = 400; | ||
+ | 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; | ||
+ | }) | ||
}); | }); | ||
</script> | </script> | ||
</html> | </html> |
Revision as of 14:23, 15 September 2015