add scrollto function

This commit is contained in:
sarah garcin 2015-05-26 18:14:30 +02:00
parent ea423f2146
commit c183a0b0dd

View File

@ -1532,6 +1532,7 @@
var materiobasetheme = new MaterioBaseTheme();
});
/**
* Attach collapse behavior to the feedback form block.
*/
@ -1568,4 +1569,17 @@
}
};
//HOME
//Click Menu and scroll to part of the page
$(".bdd").addClass('database');
$('.pane-menu-menu-home-v2 .menu li a').each(function(){
var link = $(this).attr("href");
var part = link.replace("/fr/", "");
$(this).attr('href', '#' +part);
$(this).click(function(){
var scrollTo = $('.' + part).offset().top -200;
$("body").animate({scrollTop: scrollTo}, 2000 );
})
});
})(jQuery);