Difference between revisions of "Team:SSTi-SZGD/js/Design"

(final)
Line 26: Line 26:
 
$(this).addClass("active");
 
$(this).addClass("active");
 
$(this).parent().siblings(".info").children("div").css("display","none");
 
$(this).parent().siblings(".info").children("div").css("display","none");
if(index<6){
+
if(index<5){
 
$(this).parent().siblings(".info").children("div").eq(index).css("display","block");
 
$(this).parent().siblings(".info").children("div").eq(index).css("display","block");
 
 
}else if(index<11){
+
}else if(index<10){
$(this).parent().siblings(".info").children("div").eq(index-6).css("display","block");
+
$(this).parent().siblings(".info").children("div").eq(index-5).css("display","block");
 
}else{
 
}else{
$(this).parent().siblings(".info").children("div").eq(index-11).css("display","block");
+
$(this).parent().siblings(".info").children("div").eq(index-10).css("display","block");
 
}
 
}
 
});
 
});

Revision as of 02:31, 6 November 2018

$(function(){

$(document).attr("title","Deign - Team:SSTi-SZGD - 2018.igem.org");

//transition $(".page_content").addClass("transition"); $(".page_content").find("*").addClass("transition"); $(".Content .content").removeClass("transition");

//Navigation $(".btn_nav .Project a").eq(1).addClass("active"); $(".sub_nav li.Project a").eq(1).addClass("active");

$(".page_nav ul li").removeClass("active"); $(".page_nav ul li").eq(1).addClass("active");

if(window.location.search==""){ $(".page_title").text("Deign"); }else{ $(".page_title").text("设计"); }

$(".Csubtitle span").each(function(index){ $(this).click(function(){ $(this).parent().siblings(".Csubtitle").find("span").removeClass("active"); $(this).addClass("active"); $(this).parent().siblings(".info").children("div").css("display","none"); if(index<5){ $(this).parent().siblings(".info").children("div").eq(index).css("display","block");

}else if(index<10){ $(this).parent().siblings(".info").children("div").eq(index-5).css("display","block"); }else{ $(this).parent().siblings(".info").children("div").eq(index-10).css("display","block"); } }); });

$(".Content .title").each(function(){

var control=0; $(this).click(function(){ if(control==0){ $(this).next().slideDown(); control=1; }else{ $(this).next().slideUp(); control=0; } });

});

});