Team:TU Delft/menu test
From 2010.igem.org
(Difference between revisions)
Line 91: | Line 91: | ||
var pageURL = getPageURL(page); | var pageURL = getPageURL(page); | ||
btn.click(function(event) { | btn.click(function(event) { | ||
+ | event.preventDefault(); | ||
+ | |||
var cpw = $("#content_page_wrap"); | var cpw = $("#content_page_wrap"); | ||
cpw.fadeOut(200); | cpw.fadeOut(200); | ||
- | |||
if (isUndefined(pageCache[page])) { | if (isUndefined(pageCache[page])) { | ||
Line 99: | Line 100: | ||
$.get(pageURL, function(data) { | $.get(pageURL, function(data) { | ||
pageCache[page]=data; | pageCache[page]=data; | ||
- | |||
cpw.html(data); | cpw.html(data); | ||
+ | cpw.fadeIn(200); | ||
}); | }); | ||
} | } | ||
else { | else { | ||
- | cpw. | + | cpw.queue(function(next) { |
- | + | cpw.html(pageCache[page]); | |
+ | next(); | ||
+ | }); | ||
+ | cpw.fadeIn(200); | ||
} | } | ||
Revision as of 13:59, 5 June 2010