Difference between revisions of "Team:ATOMS-Turkiye/iGEM"

Line 36: Line 36:
 
     case "Cancer_Switch":
 
     case "Cancer_Switch":
 
     case "Modelling":
 
     case "Modelling":
 +
    case "Safety":
 +
    case "Future_Plan":
 
         initiateNavigation("project");
 
         initiateNavigation("project");
 
         break;
 
         break;
Line 45: Line 47:
 
     case "Outreach":
 
     case "Outreach":
 
     case "Street_Interview":
 
     case "Street_Interview":
 +
    case "Video":
 
         initiateNavigation("pp");
 
         initiateNavigation("pp");
 
         break;
 
         break;

Revision as of 01:58, 19 September 2015

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").hoverIntent(function(){
       $(".nav-item.active").removeClass("active");
       $(this).addClass("active");
       $("#sub-navigation > ul").hide();
       $("#" + this.id + "-sub").show();
   });
   var pathname = window.location.pathname.split("/").pop();

switch(pathname) {

   case "Tour":
       initiateNavigation("tour");
       break;
   case "Problems":
   case "Ulcer":
   case "Cancer_Switch":
   case "Modelling":
   case "Safety":
   case "Future_Plan":
       initiateNavigation("project");
       break;
   case "Results":
       initiateNavigation("results");
       break;
   case "Virtual_Hospital":
   case "SynBio_Day":
   case "Outreach":
   case "Street_Interview":
   case "Video":
       initiateNavigation("pp");
       break;
   case "ATOMs":
   case "Attribitions":
   case "Collaboration":
   case "Official_Team_Profile":
   case "Acknowledgements":
       initiateNavigation("team");
       break;
   case "Notebook":
   case "Protocols":
   case "Achievements":
   case "Official_Part_Page":
       initiateNavigation("extras");
       break;

} };