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

(final)
(final)
 
Line 8: Line 8:
 
 
 
//Navigation
 
//Navigation
$(".btn_nav .Project a").eq(0).addClass("active");
+
$(".btn_nav .Application a").eq(2).addClass("active");
$(".sub_nav li.Project a").eq(0).addClass("active");
+
$(".sub_nav li.Application a").eq(2).addClass("active");
 
 
 
$(".page_nav ul li").removeClass("active");
 
$(".page_nav ul li").removeClass("active");
$(".page_nav ul li").eq(1).addClass("active");
+
$(".page_nav ul li").eq(3).addClass("active");
 
 
 
if(window.location.search==""){
 
if(window.location.search==""){

Latest revision as of 15:46, 7 November 2018

$(function(){

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

//add transition $(".page_content").addClass("transition"); $(".page_content").find("*").addClass("transition");

//Navigation $(".btn_nav .Application a").eq(2).addClass("active"); $(".sub_nav li.Application a").eq(2).addClass("active");

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

if(window.location.search==""){ $(".page_title").text("Demonstrate"); }else{ $(".page_title").text("证明"); }


if(/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry|iPad/i.test(navigator.userAgent)){

//Banner if($(window).width()<768){ $(".Banner").css({"height":"300px","background-size":"85%","margin":"50px 0 0 0"}); }else{ $(".Banner").css({"height":"600px","background-size":"70%","margin":"100px 0 0 0"}); }

if(window.orientation=="-90"||window.orientation=="90"){ if($(window).height()>=330){ $(".Banner").css({"margin-top":"100px"}); } }

}


$(window).resize(function(){

if(/Android|Windows Phone|webOS|iPhone|iPod|BlackBerry|iPad/i.test(navigator.userAgent)){ if($(window).width()<768){ $(".Banner").css({"height":"300px","background-size":"85%","margin":"50px 0 0 0"}); }else{ $(".Banner").css({"height":"600px","background-size":"70%","margin":"100px 0 0 0"}); }

if(window.orientation=="-90"||window.orientation=="90"){ if($(window).height()>=330){ $(".Banner").css({"margin-top":"100px"}); } }

}

});


$(".card_content").eq(0).css("display","block");

//card_content_Tab $(".card_title span").each(function(index){ $(this).click(function(){ $(".card_title div").removeClass("active"); $(".card_title div").eq(index).addClass("active"); $(".card_content").css("display","none"); $(".card_content").eq(index).css("display","block"); if(index==0){ $(".card_content").css("border-radius","0 10px 10px 10px"); }else if(index==1){ $(".card_content").css("border-radius","10px"); }else{ $(".card_content").css("border-radius","10px 0 10px 10px"); } }); });

});