From c183a0b0dd04999cb5f830ce0faeb3ef4ca84a43 Mon Sep 17 00:00:00 2001 From: sarah garcin Date: Tue, 26 May 2015 18:14:30 +0200 Subject: [PATCH] add scrollto function --- sites/all/themes/gui/materiobasetheme/js/script.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sites/all/themes/gui/materiobasetheme/js/script.js b/sites/all/themes/gui/materiobasetheme/js/script.js index 006f1056..d18b47a5 100644 --- a/sites/all/themes/gui/materiobasetheme/js/script.js +++ b/sites/all/themes/gui/materiobasetheme/js/script.js @@ -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);