Team:SYSU-Software/prefix.js
From 2014.igem.org
Line 5: | Line 5: | ||
success: function(html){ | success: function(html){ | ||
$("#navigation").append($(html).find(".sysu-header").html()); | $("#navigation").append($(html).find(".sysu-header").html()); | ||
- | var url = window.location.href; | + | var url = window.location.href; |
- | if(url == "https:// | + | if(url == "https://2014.igem.org/Team:SYSU-Software") |
{ | { | ||
$(".nav-li:first").addClass("active"); | $(".nav-li:first").addClass("active"); | ||
} | } | ||
- | else if((url == "https:// | + | else if((url == "https://2014.igem.org/Team:SYSU-Software/overview") || (url == "https://2013.igem.org/Team:SYSU-Software/demo") || |
(url == "https://2013.igem.org/Team:SYSU-Software/download") || (url == "https://2013.igem.org/Team:SYSU-Software/part1") || | (url == "https://2013.igem.org/Team:SYSU-Software/download") || (url == "https://2013.igem.org/Team:SYSU-Software/part1") || | ||
(url == "https://2013.igem.org/Team:SYSU-Software/part2") || (url == "https://2013.igem.org/Team:SYSU-Software/part3")) | (url == "https://2013.igem.org/Team:SYSU-Software/part2") || (url == "https://2013.igem.org/Team:SYSU-Software/part3")) | ||
Line 30: | Line 30: | ||
cache: false, | cache: false, | ||
success: function(html){ | success: function(html){ | ||
- | $("sysu-footer").append($(html).find("footer").html()); | + | $("sysu-footer").append($(html).find("sysu-footer").html()); |
} | } | ||
}); | }); | ||
} | } |
Revision as of 12:13, 26 July 2014
window.onload = function(){ $.ajax({ url: "/Team:SYSU-Software/header", cache: true, success: function(html){ $("#navigation").append($(html).find(".sysu-header").html());
var url = window.location.href;
if(url == "https://2014.igem.org/Team:SYSU-Software") { $(".nav-li:first").addClass("active"); } else if((url == "https://2014.igem.org/Team:SYSU-Software/overview") || (url == "https://2013.igem.org/Team:SYSU-Software/demo") || (url == "https://2013.igem.org/Team:SYSU-Software/download") || (url == "https://2013.igem.org/Team:SYSU-Software/part1") || (url == "https://2013.igem.org/Team:SYSU-Software/part2") || (url == "https://2013.igem.org/Team:SYSU-Software/part3")) $(".nav-li:eq(1)").addClass("active"); else if((url == "https://2013.igem.org/Team:SYSU-Software/model") || (url == "https://2013.igem.org/Team:SYSU-Software/notebook")|| (url == "https://2013.igem.org/Team:SYSU-Software/tutorial")) $(".nav-li:eq(2)").addClass("active"); else if((url == "https://2013.igem.org/Team:SYSU-Software/require")|| (url == "https://2013.igem.org/Team:SYSU-Software/saft")|| (url == "https://2013.igem.org/Team:SYSU-Software/colla")) $(".nav-li:eq(3)").addClass("active"); else if((url == "https://2013.igem.org/Team:SYSU-Software/humanpra")) $(".nav-li:eq(4)").addClass("active"); else if((url == "https://2013.igem.org/Team:SYSU-Software/team")) $(".nav-li:eq(5)").addClass("active"); } });
$.ajax({ url: "/Team:SYSU-Software/footer", cache: false, success: function(html){ $("sysu-footer").append($(html).find("sysu-footer").html()); } }); }