Team:TU Delft/menu test

From 2010.igem.org

(Difference between revisions)
Line 81: Line 81:
function setupPage(page) {
function setupPage(page) {
   var btn= $(".menu_button_" + page);
   var btn= $(".menu_button_" + page);
-
   var page = "https://2010.igem.org/Team:TU_Delft/pages/" + page + "?action=render";
+
   var pageURL = "https://2010.igem.org/Team:TU_Delft/pages/" + page + "?action=render";
   btn.click(function() {
   btn.click(function() {
     var cpw = $("#content_page_wrap");
     var cpw = $("#content_page_wrap");
-
     cpw.fadeOut(100);
+
     cpw.fadeOut(200);
-
     $.get(page, function(data) {  
+
     $.get(pageURL, function(data) {  
         cpw.html(data);
         cpw.html(data);
         cpw.fadeIn(200);
         cpw.fadeIn(200);
Line 92: Line 92:
   // setup hovering
   // setup hovering
 +
  var btnCssClassSelected = "menu_button_" + page + "_sel";
   btn.hover(function() {
   btn.hover(function() {
-
     btn.addClass("button_hover");
+
     btn.addClass(btnCssClassSelected);
   }, function() {
   }, function() {
-
     btn.removeClass("button_hover");
+
     btn.removeClass(btnCssClassSelected);
   });
   });

Revision as of 10:55, 5 June 2010