Permalink
Browse files

Fix scroll on chrome.

  • Loading branch information...
paulmillr committed Apr 9, 2012
1 parent f4a241f commit 1eb4cc29f32fb921866e59d35d4c64bd27315f91
Showing with 6 additions and 2 deletions.
  1. +6 −2 javascripts/main.js
View
@@ -19,9 +19,13 @@ $(document).ready(function(){
$("nav ul li:first-child a").parent().addClass("active");
});
- $("nav ul li a").live("click",function(event) {
+ $("nav ul li").on("click", "a", function(event) {
var position = $($(this).attr("href")).offset().top - 190;
- $("html").animate({scrollTop: position},400);
+ var scroll = function(element) {
+ $(element).animate({scrollTop: position}, 400);
+ };
+ scroll("html");
+ scroll("body");
$("nav ul li a").parent().removeClass("active");
$(this).parent().addClass("active");
event.preventDefault();

0 comments on commit 1eb4cc2

Please sign in to comment.