Template:Team:Berkeley/scrollspyOffset.js
From 2013.igem.org
(Difference between revisions)
Line 1: | Line 1: | ||
- | + | $('#navbar ul li a').bind('click', function(e) { | |
- | + | e.preventDefault(); | |
- | $(' | + | $('html, body').animate({ |
- | + | scrollTop: $(this.hash).offset().top -190 | |
- | $($(this | + | }, 300); |
- | + | // edit: Opera requires the "html" elm. animated | |
}); | }); |
Revision as of 02:07, 28 October 2013
$('#navbar ul li a').bind('click', function(e) {
e.preventDefault(); $('html, body').animate({ scrollTop: $(this.hash).offset().top -190 }, 300); // edit: Opera requires the "html" elm. animated
});