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 | + | 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( | + | cpw.fadeOut(200); |
- | $.get( | + | $.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( | + | btn.addClass(btnCssClassSelected); |
}, function() { | }, function() { | ||
- | btn.removeClass( | + | btn.removeClass(btnCssClassSelected); |
}); | }); | ||
Revision as of 10:55, 5 June 2010