Commit a155f0f1 authored by Martin Markech's avatar Martin Markech
Browse files

fix #2 slide_to JS function don't work in Chrome

parent 22cb6ceb
......@@ -3,11 +3,11 @@ if (history && history.pushState) {
var scrollToPosition = $(target).offset().top;
console.log(scrollToPosition);
$('html').animate({ 'scrollTop': scrollToPosition }, 600, function(){
$("html,body").animate({ 'scrollTop': scrollToPosition }, 600, function(){
//window.location.hash = "" + target;
// This hash change will jump the page to the top of the div with the same id
// so we need to force the page to back to the end of the animation
$('html').animate({ 'scrollTop': scrollToPosition }, 0);
$("html,body").animate({ 'scrollTop': scrollToPosition }, 0);
});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment