Team:TU Delft/menu test

From 2010.igem.org

(Difference between revisions)
Line 78: Line 78:
function isUndefined(x) { var u; return x === u; }
function isUndefined(x) { var u; return x === u; }
 +
 +
var activePage = "</html>{{{contentpage|home}}}<html>";
function setupPage(page) {
function setupPage(page) {
Line 86: Line 88:
     cpw.fadeOut(200);
     cpw.fadeOut(200);
     event.preventDefault();
     event.preventDefault();
 +
   
     $.get(pageURL, function(data) {  
     $.get(pageURL, function(data) {  
         cpw.html(data);
         cpw.html(data);
         cpw.fadeIn(200);
         cpw.fadeIn(200);
     });
     });
 +
   
 +
    btn.removeClass("menu_button_"+activePage+"_sel");
 +
    activePage = page;
 +
    btn.addClass("menu_button_"+activePage+"_sel");
 +
   
   });
   });
Line 99: Line 107:
     btn.removeClass(btnCssClassSelected);
     btn.removeClass(btnCssClassSelected);
   });
   });
-
 
-
  var activePage = "</html>{{{contentpage|home}}}<html>";
 
   btn.addClass("button_pointer");
   btn.addClass("button_pointer");
   if (page == activePage)
   if (page == activePage)
     btn.addClass("menu_button_"+activePage+"_sel");
     btn.addClass("menu_button_"+activePage+"_sel");
-
   
 
}
}

Revision as of 11:27, 5 June 2010