Browse Source

add scrollto function

sarah garcin 9 years ago
parent
commit
c183a0b0dd
1 changed files with 14 additions and 0 deletions
  1. 14 0
      sites/all/themes/gui/materiobasetheme/js/script.js

+ 14 - 0
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);