Template:Team:Berkeley/scrollspyOffset.js

From 2013.igem.org

(Difference between revisions)
Line 1: Line 1:
-
var offset = 180;
+
<script>
 +
var offset = 81;
$('#navbar li a').click(function(event) {
$('#navbar li a').click(function(event) {
Line 6: Line 7:
     scrollBy(0, -offset);
     scrollBy(0, -offset);
});
});
 +
</script>

Revision as of 16:52, 28 October 2013

<script> var offset = 81;

$('#navbar li a').click(function(event) {

   event.preventDefault();
   $($(this).attr('href'))[0].scrollIntoView();
   scrollBy(0, -offset);

}); </script>