Team:LMU-Munich/iGEM.js

From 2014.igem.org

Revision as of 18:52, 17 October 2014 by Hoerldavid (Talk | contribs)

var initiateNavigation = function(id){

   $("#"+id).addClass("current-top-nav");
   $(".nav-item.active").removeClass("active");
   $("#"+id).addClass("active");
   $("#sub-navigation > ul").hide();
   $("#" + id + "-sub").show();
   
   $.fn.xscrolly = function(options, key, value) {
     if (options === 'option') {
       this.data('xscrolly').option(key, value);
     } else {
       options.targets = this;
       this.data('xscrolly', new XScrollY(options));
     }
     return this;

};

};

window.onload = function(){

   //hoverIntent is used for predicting user mouse intentions
   $(".nav-item").not(".tour_toggle").hoverIntent(function(){
       $(".nav-item.active").removeClass("active");
       $(this).addClass("active");
       $("#sub-navigation > ul").hide();
       $("#" + this.id + "-sub").show();
   });
   
   // scroll-spy functionality moved to ajaxload.js
   /*
   $('.scroll-spy').xscrolly({
     change: function($el) {
       //$el.addClass('active');
       
       // remove active
       $(".active-item").removeClass("active-item");
       
       // reset navigation
       $(".nav-item.active").removeClass("active");
       $(".current-top-nav").addClass("active");
       $("#sub-navigation > ul").hide();
       $("#" + $(".current-top-nav").attr('id') + "-sub").show();
       
   
       // scroll spy
       console.log("#inpage-nav-" + $el.data("scroll"));
       $("#inpage-nav-" + $el.data("scroll")).addClass("active-item");
     }
   });
   */

};