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

 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
/*自定义Project效果*/
+
/*custom Project Effect*/
 
$(function(){
 
$(function(){
 
 
$(".header .nav .mainnav").eq(2).hover(function(){
+
$(".header .nav .mainnav").eq(1).hover(function(){
 
$(".header .nav .Project span").css("color","#FAEE0D");
 
$(".header .nav .Project span").css("color","#FAEE0D");
 
},function(){
 
},function(){
Line 10: Line 10:
 
});
 
});
  
/*跟随窗口大小的高度*/
+
/*Follow the height of the window size*/
 
$(function(){
 
$(function(){
 
 
var winHeight=$(window).height();
+
var winHeight=$(window).outerHeight();
+
if(winHeight>=489){
console.log(winHeight);
+
$(".SSTi-SZGD").css("height",winHeight);
+
if(winHeight>=465){
+
$(".pdf").css("height",winHeight);
+
 
}
 
}
 
else{
 
else{
winHeight=465;
+
$(".SSTi-SZGD").css("height","489px");
$(".pdf").css("height",winHeight);
+
 
}
 
}
 
 
 
$(window).resize(function(){
 
$(window).resize(function(){
 
 
winHeight=$(window).height();
+
winHeight=$(window).outerHeight();
+
if(winHeight>=489){
console.log(winHeight);
+
$(".SSTi-SZGD").css("height",winHeight);
+
}else{
if(winHeight>=465){
+
$(".SSTi-SZGD").css("height","489px");
$(".pdf").css("height",winHeight);
+
}
+
else{
+
winHeight=465;
+
$(".pdf").css("height",winHeight);
+
 
}
 
}
 
 
 
});
 
});
+
 
});
 
});
  
/*pdf禁止滑轮*/
+
/*Switch calendar*/
 
$(function(){
 
$(function(){
$(".pdf").mouseover(function(){
+
$("html").bind("mousewheel DOMMouseScroll",function(){
+
//March
return false;
+
$(".March .icon_left").click(function(){
});
+
 +
$(".Sth").css({"background":"#75B574","transition":"background 2s"});
 +
$(".October").removeClass("a-fadeout");
 +
$(".March").removeClass("a-fadein");
 +
$(".March").addClass("a-fadeout");
 +
$(".October").addClass("a-fadein");
 +
$(".October").css("display","block");
 +
setTimeout(function(){
 +
$(".March").css("display","none");
 +
},1000);
 +
 
});
 
});
$(".pdf").mouseout(function(){
+
$(".pdf").css("background","yellow");
+
$(".March .icon_right").click(function(){
$("html").unbind("mousewheel DOMMouseScroll");
+
 +
$(".Sth").css({"background":"#87589E","transition":"background 2s"});
 +
$(".March").removeClass("a-fadein");
 +
$(".April").removeClass("a-fadeout");
 +
$(".March").addClass("a-fadeout");
 +
$(".April").addClass("a-fadein");
 +
$(".April").css("display","block");
 +
setTimeout(function(){
 +
$(".March").css("display","none");
 +
},1000);
 +
 
});
 
});
 +
 +
$(".March .sth").click(function(){
 +
 +
$(".calendar .sth").css({"background":"none","color":"#333333"});
 +
$(".May .day_x:first li").css("color","#5DA0CA");
 +
$(".calendar .sth .focus").css("display","block");
 +
$(this).children().css("display","none");
 +
$(this).css({"background":"#537BB6","color":"white"});
 +
 +
var Month="March";
 +
var Day="D"+String(parseInt($(this).text()));
 +
$(".Sth").html(Json[Month][Day]);
 +
 +
});
 +
 +
 +
//April
 +
$(".April .icon_left").click(function(){
 +
 +
$(".Sth").css({"background":"#5DA0CA","transition":"background 2s"});
 +
$(".March").removeClass("a-fadeout");
 +
$(".April").removeClass("a-fadein");
 +
$(".April").addClass("a-fadeout");
 +
$(".March").addClass("a-fadein");
 +
$(".March").css("display","block");
 +
setTimeout(function(){
 +
$(".April").css("display","none");
 +
},1000);
 +
 +
});
 +
 +
$(".April .icon_right").click(function(){
 +
 +
$(".Sth").css({"background":"#424D5F","transition":"background 2s"});
 +
$(".May").removeClass("a-fadeout");
 +
$(".April").removeClass("a-fadein");
 +
$(".April").addClass("a-fadeout");
 +
$(".May").addClass("a-fadein");
 +
$(".May").css("display","block");
 +
setTimeout(function(){
 +
$(".April").css("display","none");
 +
},1000);
 +
 +
});
 +
 +
$(".April .sth").click(function(){
 +
 +
$(".calendar .sth").css({"background":"none","color":"#333333"});
 +
$(".May .day_x:first li").css("color","#87589E");
 +
$(".calendar .sth .focus").css("display","block");
 +
$(this).children().css("display","none");
 +
$(this).css({"background":"#7F4599","color":"white"});
 +
 +
var Month="April";
 +
var Day="D"+String(parseInt($(this).text()));
 +
$(".Sth").html(Json[Month][Day]);
 +
 +
});
 +
 +
 +
//May
 +
$(".May .icon_left").click(function(){
 +
 +
 +
$(".Sth").css({"background":"#87589E","transition":"background 2s"});
 +
$(".April").removeClass("a-fadeout");
 +
$(".May").removeClass("a-fadein");
 +
$(".May").addClass("a-fadeout");
 +
$(".April").addClass("a-fadein");
 +
$(".April").css("display","block");
 +
setTimeout(function(){
 +
$(".May").css("display","none");
 +
},1000);
 +
 +
});
 +
 +
$(".May .icon_right").click(function(){
 +
 +
$(".Sth").css({"background":"#E2C337","transition":"background 2s"});
 +
$(".June").removeClass("a-fadeout");
 +
$(".May").removeClass("a-fadein");
 +
$(".May").addClass("a-fadeout");
 +
$(".June").addClass("a-fadein");
 +
$(".June").css("display","block");
 +
setTimeout(function(){
 +
$(".May").css("display","none");
 +
},1000);
 +
 +
});
 +
 +
$(".May .sth").click(function(){
 +
 +
$(".calendar .sth").css({"background":"none","color":"#333333"});
 +
$(".May .day_x:first li").css("color","#424D5F");
 +
$(".calendar .sth .focus").css("display","block");
 +
$(this).children().css("display","none");
 +
$(this).css({"background":"#3C4352","color":"white"});
 +
 +
var Month="May";
 +
var Day="D"+String(parseInt($(this).text()));
 +
$(".Sth").html(Json[Month][Day]);
 +
 +
});
 +
 +
 +
//June
 +
$(".June .icon_left").click(function(){
 +
 +
$(".Sth").css({"background":"#424D5F","transition":"background 2s"});
 +
$(".May").removeClass("a-fadeout");
 +
$(".June").removeClass("a-fadein");
 +
$(".June").addClass("a-fadeout");
 +
$(".May").addClass("a-fadein");
 +
$(".May").css("display","block");
 +
setTimeout(function(){
 +
$(".June").css("display","none");
 +
},1000);
 +
 +
});
 +
 +
$(".June .icon_right").click(function(){
 +
 +
$(".Sth").css({"background":"#CD7F34","transition":"background 2s"});
 +
$(".July").removeClass("a-fadeout");
 +
$(".June").removeClass("a-fadein");
 +
$(".June").addClass("a-fadeout");
 +
$(".July").addClass("a-fadein");
 +
$(".July").css("display","block");
 +
setTimeout(function(){
 +
$(".June").css("display","none");
 +
},1000);
 +
 +
});
 +
 +
$(".June .sth").click(function(){
 +
 +
$(".calendar .sth").css({"background":"none","color":"#333333"});
 +
$(".May .day_x:first li").css("color","#E2C337");
 +
$(".calendar .sth .focus").css("display","block");
 +
$(this).children().css("display","none");
 +
$(this).css({"background":"#DB9A37","color":"white"});
 +
 +
var Month="June";
 +
var Day="D"+String(parseInt($(this).text()));
 +
$(".Sth").html(Json[Month][Day]);
 +
 +
});
 +
 +
 +
//July
 +
$(".July .icon_left").click(function(){
 +
 +
$(".Sth").css({"background":"#E2C337","transition":"background 2s"});
 +
$(".June").removeClass("a-fadeout");
 +
$(".July").removeClass("a-fadein");
 +
$(".July").addClass("a-fadeout");
 +
$(".June").addClass("a-fadein");
 +
$(".June").css("display","block");
 +
setTimeout(function(){
 +
$(".July").css("display","none");
 +
},1000);
 +
 +
});
 +
 +
$(".July .icon_right").click(function(){
 +
 +
$(".Sth").css({"background":"#C65340","transition":"background 2s"});
 +
$(".August").removeClass("a-fadeout");
 +
$(".July").removeClass("a-fadein");
 +
$(".July").addClass("a-fadeout");
 +
$(".August").addClass("a-fadein");
 +
$(".August").css("display","block");
 +
setTimeout(function(){
 +
$(".July").css("display","none");
 +
},1000);
 +
 +
});
 +
 +
$(".July .sth").click(function(){
 +
 +
$(".calendar .sth").css({"background":"none","color":"#333333"});
 +
$(".June .day_x:first li").css("color","#CD7F34");
 +
$(".calendar .sth .focus").css("display","block");
 +
$(this).children().css("display","none");
 +
$(this).css({"background":"#B9592E","color":"white"});
 +
 +
var Month="July";
 +
var Day="D"+String(parseInt($(this).text()));
 +
$(".Sth").html(Json[Month][Day]);
 +
 +
});
 +
 +
 +
//August
 +
$(".August .icon_left").click(function(){
 +
 +
$(".Sth").css({"background":"#CD7F34","transition":"background 2s"});
 +
$(".July").removeClass("a-fadeout");
 +
$(".August").removeClass("a-fadein");
 +
$(".August").addClass("a-fadeout");
 +
$(".July").addClass("a-fadein");
 +
$(".July").css("display","block");
 +
setTimeout(function(){
 +
$(".August").css("display","none");
 +
},1000);
 +
 +
});
 +
 +
$(".August .icon_right").click(function(){
 +
 +
$(".Sth").css({"background":"#87589E","transition":"background 2s"});
 +
$(".July").removeClass("a-fadeout");
 +
$(".September").removeClass("a-fadeout");
 +
$(".August").removeClass("a-fadein");
 +
$(".August").addClass("a-fadeout");
 +
$(".September").addClass("a-fadein");
 +
$(".September").css("display","block");
 +
setTimeout(function(){
 +
$(".August").css("display","none");
 +
},1000);
 +
 +
});
 +
 +
$(".August .sth").click(function(){
 +
 +
$(".calendar .sth").css({"background":"none","color":"#333333"});
 +
$(".August .day_x:first li").css("color","#C65340");
 +
$(".calendar .sth .focus").css("display","block");
 +
$(this).children().css("display","none");
 +
$(this).css({"background":"#A34233","color":"white"});
 +
 +
var Month="August";
 +
var Day="D"+String(parseInt($(this).text()));
 +
$(".Sth").html(Json[Month][Day]);
 +
 +
});
 +
 +
 +
//September
 +
$(".September .icon_left").click(function(){
 +
 +
$(".Sth").css({"background":"#C65340","transition":"background 2s"});
 +
$(".August").removeClass("a-fadeout");
 +
$(".September").removeClass("a-fadein");
 +
$(".September").addClass("a-fadeout");
 +
$(".August").addClass("a-fadein");
 +
$(".August").css("display","block");
 +
setTimeout(function(){
 +
$(".September").css("display","none");
 +
},1000);
 +
 +
});
 +
 +
$(".September .icon_right").click(function(){
 +
 +
$(".Sth").css({"background":"#75B574","transition":"background 2s"});
 +
$(".October").removeClass("a-fadeout");
 +
$(".September").removeClass("a-fadein");
 +
$(".September").addClass("a-fadeout");
 +
$(".October").addClass("a-fadein");
 +
$(".October").css("display","block");
 +
setTimeout(function(){
 +
$(".September").css("display","none");
 +
},1000);
 +
 +
});
 +
 +
$(".September .sth").click(function(){
 +
 +
$(".calendar .sth").css({"background":"none","color":"#333333"});
 +
$(".September .day_x:first li").css("color","#87589E");
 +
$(".calendar .sth .focus").css("display","block");
 +
$(this).children().css("display","none");
 +
$(this).css({"background":"#764595","color":"white"});
 +
 +
var Month="September";
 +
var Day="D"+String(parseInt($(this).text()));
 +
$(".Sth").html(Json[Month][Day]);
 +
 +
});
 +
 +
 +
//October
 +
$(".October .icon_left").click(function(){
 +
 +
$(".Sth").css({"background":"#87589E","transition":"background 2s"});
 +
$(".September").removeClass("a-fadeout");
 +
$(".October").removeClass("a-fadein");
 +
$(".October").addClass("a-fadeout");
 +
$(".September").addClass("a-fadein");
 +
$(".September").css("display","block");
 +
setTimeout(function(){
 +
$(".October").css("display","none");
 +
},1000);
 +
 +
});
 +
 +
$(".October .icon_right").click(function(){
 +
 +
$(".Sth").css({"background":"#5DA0CA","transition":"background 2s"});
 +
$(".March").removeClass("a-fadeout");
 +
$(".October").removeClass("a-fadein");
 +
$(".October").addClass("a-fadeout");
 +
$(".March").addClass("a-fadein");
 +
$(".March").css("display","block");
 +
setTimeout(function(){
 +
$(".October").css("display","none");
 +
},1000);
 +
 +
});
 +
 +
$(".October .sth").click(function(){
 +
 +
$(".calendar .sth").css({"background":"none","color":"#333333"});
 +
$(".October .day_x:first li").css("color","#75B574");
 +
$(".calendar .sth .focus").css("display","block");
 +
$(this).children().css("display","none");
 +
$(this).css({"background":"#5FA768","color":"white"});
 +
 +
var Month="October";
 +
var Day="D"+String(parseInt($(this).text()));
 +
$(".Sth").html(Json[Month][Day]);
 +
 +
});
 +
 
});
 
});

Latest revision as of 00:58, 30 October 2017

/*custom Project Effect*/ $(function(){

$(".header .nav .mainnav").eq(1).hover(function(){ $(".header .nav .Project span").css("color","#FAEE0D"); },function(){ $(".header .nav .Project span").css("color","#FAEE0D"); });

});

/*Follow the height of the window size*/ $(function(){

var winHeight=$(window).outerHeight(); if(winHeight>=489){ $(".SSTi-SZGD").css("height",winHeight); } else{ $(".SSTi-SZGD").css("height","489px"); }

$(window).resize(function(){

winHeight=$(window).outerHeight(); if(winHeight>=489){ $(".SSTi-SZGD").css("height",winHeight); }else{ $(".SSTi-SZGD").css("height","489px"); }

});

});

/*Switch calendar*/ $(function(){

//March $(".March .icon_left").click(function(){

$(".Sth").css({"background":"#75B574","transition":"background 2s"}); $(".October").removeClass("a-fadeout"); $(".March").removeClass("a-fadein"); $(".March").addClass("a-fadeout"); $(".October").addClass("a-fadein"); $(".October").css("display","block"); setTimeout(function(){ $(".March").css("display","none"); },1000);

});

$(".March .icon_right").click(function(){

$(".Sth").css({"background":"#87589E","transition":"background 2s"}); $(".March").removeClass("a-fadein"); $(".April").removeClass("a-fadeout"); $(".March").addClass("a-fadeout"); $(".April").addClass("a-fadein"); $(".April").css("display","block"); setTimeout(function(){ $(".March").css("display","none"); },1000);

});

$(".March .sth").click(function(){

$(".calendar .sth").css({"background":"none","color":"#333333"}); $(".May .day_x:first li").css("color","#5DA0CA"); $(".calendar .sth .focus").css("display","block"); $(this).children().css("display","none"); $(this).css({"background":"#537BB6","color":"white"});

var Month="March"; var Day="D"+String(parseInt($(this).text())); $(".Sth").html(Json[Month][Day]);

});


//April $(".April .icon_left").click(function(){

$(".Sth").css({"background":"#5DA0CA","transition":"background 2s"}); $(".March").removeClass("a-fadeout"); $(".April").removeClass("a-fadein"); $(".April").addClass("a-fadeout"); $(".March").addClass("a-fadein"); $(".March").css("display","block"); setTimeout(function(){ $(".April").css("display","none"); },1000);

});

$(".April .icon_right").click(function(){

$(".Sth").css({"background":"#424D5F","transition":"background 2s"}); $(".May").removeClass("a-fadeout"); $(".April").removeClass("a-fadein"); $(".April").addClass("a-fadeout"); $(".May").addClass("a-fadein"); $(".May").css("display","block"); setTimeout(function(){ $(".April").css("display","none"); },1000);

});

$(".April .sth").click(function(){

$(".calendar .sth").css({"background":"none","color":"#333333"}); $(".May .day_x:first li").css("color","#87589E"); $(".calendar .sth .focus").css("display","block"); $(this).children().css("display","none"); $(this).css({"background":"#7F4599","color":"white"});

var Month="April"; var Day="D"+String(parseInt($(this).text())); $(".Sth").html(Json[Month][Day]);

});


//May $(".May .icon_left").click(function(){


$(".Sth").css({"background":"#87589E","transition":"background 2s"}); $(".April").removeClass("a-fadeout"); $(".May").removeClass("a-fadein"); $(".May").addClass("a-fadeout"); $(".April").addClass("a-fadein"); $(".April").css("display","block"); setTimeout(function(){ $(".May").css("display","none"); },1000);

});

$(".May .icon_right").click(function(){

$(".Sth").css({"background":"#E2C337","transition":"background 2s"}); $(".June").removeClass("a-fadeout"); $(".May").removeClass("a-fadein"); $(".May").addClass("a-fadeout"); $(".June").addClass("a-fadein"); $(".June").css("display","block"); setTimeout(function(){ $(".May").css("display","none"); },1000);

});

$(".May .sth").click(function(){

$(".calendar .sth").css({"background":"none","color":"#333333"}); $(".May .day_x:first li").css("color","#424D5F"); $(".calendar .sth .focus").css("display","block"); $(this).children().css("display","none"); $(this).css({"background":"#3C4352","color":"white"});

var Month="May"; var Day="D"+String(parseInt($(this).text())); $(".Sth").html(Json[Month][Day]);

});


//June $(".June .icon_left").click(function(){

$(".Sth").css({"background":"#424D5F","transition":"background 2s"}); $(".May").removeClass("a-fadeout"); $(".June").removeClass("a-fadein"); $(".June").addClass("a-fadeout"); $(".May").addClass("a-fadein"); $(".May").css("display","block"); setTimeout(function(){ $(".June").css("display","none"); },1000);

});

$(".June .icon_right").click(function(){

$(".Sth").css({"background":"#CD7F34","transition":"background 2s"}); $(".July").removeClass("a-fadeout"); $(".June").removeClass("a-fadein"); $(".June").addClass("a-fadeout"); $(".July").addClass("a-fadein"); $(".July").css("display","block"); setTimeout(function(){ $(".June").css("display","none"); },1000);

});

$(".June .sth").click(function(){

$(".calendar .sth").css({"background":"none","color":"#333333"}); $(".May .day_x:first li").css("color","#E2C337"); $(".calendar .sth .focus").css("display","block"); $(this).children().css("display","none"); $(this).css({"background":"#DB9A37","color":"white"});

var Month="June"; var Day="D"+String(parseInt($(this).text())); $(".Sth").html(Json[Month][Day]);

});


//July $(".July .icon_left").click(function(){

$(".Sth").css({"background":"#E2C337","transition":"background 2s"}); $(".June").removeClass("a-fadeout"); $(".July").removeClass("a-fadein"); $(".July").addClass("a-fadeout"); $(".June").addClass("a-fadein"); $(".June").css("display","block"); setTimeout(function(){ $(".July").css("display","none"); },1000);

});

$(".July .icon_right").click(function(){

$(".Sth").css({"background":"#C65340","transition":"background 2s"}); $(".August").removeClass("a-fadeout"); $(".July").removeClass("a-fadein"); $(".July").addClass("a-fadeout"); $(".August").addClass("a-fadein"); $(".August").css("display","block"); setTimeout(function(){ $(".July").css("display","none"); },1000);

});

$(".July .sth").click(function(){

$(".calendar .sth").css({"background":"none","color":"#333333"}); $(".June .day_x:first li").css("color","#CD7F34"); $(".calendar .sth .focus").css("display","block"); $(this).children().css("display","none"); $(this).css({"background":"#B9592E","color":"white"});

var Month="July"; var Day="D"+String(parseInt($(this).text())); $(".Sth").html(Json[Month][Day]);

});


//August $(".August .icon_left").click(function(){

$(".Sth").css({"background":"#CD7F34","transition":"background 2s"}); $(".July").removeClass("a-fadeout"); $(".August").removeClass("a-fadein"); $(".August").addClass("a-fadeout"); $(".July").addClass("a-fadein"); $(".July").css("display","block"); setTimeout(function(){ $(".August").css("display","none"); },1000);

});

$(".August .icon_right").click(function(){

$(".Sth").css({"background":"#87589E","transition":"background 2s"}); $(".July").removeClass("a-fadeout"); $(".September").removeClass("a-fadeout"); $(".August").removeClass("a-fadein"); $(".August").addClass("a-fadeout"); $(".September").addClass("a-fadein"); $(".September").css("display","block"); setTimeout(function(){ $(".August").css("display","none"); },1000);

});

$(".August .sth").click(function(){

$(".calendar .sth").css({"background":"none","color":"#333333"}); $(".August .day_x:first li").css("color","#C65340"); $(".calendar .sth .focus").css("display","block"); $(this).children().css("display","none"); $(this).css({"background":"#A34233","color":"white"});

var Month="August"; var Day="D"+String(parseInt($(this).text())); $(".Sth").html(Json[Month][Day]);

});


//September $(".September .icon_left").click(function(){

$(".Sth").css({"background":"#C65340","transition":"background 2s"}); $(".August").removeClass("a-fadeout"); $(".September").removeClass("a-fadein"); $(".September").addClass("a-fadeout"); $(".August").addClass("a-fadein"); $(".August").css("display","block"); setTimeout(function(){ $(".September").css("display","none"); },1000);

});

$(".September .icon_right").click(function(){

$(".Sth").css({"background":"#75B574","transition":"background 2s"}); $(".October").removeClass("a-fadeout"); $(".September").removeClass("a-fadein"); $(".September").addClass("a-fadeout"); $(".October").addClass("a-fadein"); $(".October").css("display","block"); setTimeout(function(){ $(".September").css("display","none"); },1000);

});

$(".September .sth").click(function(){

$(".calendar .sth").css({"background":"none","color":"#333333"}); $(".September .day_x:first li").css("color","#87589E"); $(".calendar .sth .focus").css("display","block"); $(this).children().css("display","none"); $(this).css({"background":"#764595","color":"white"});

var Month="September"; var Day="D"+String(parseInt($(this).text())); $(".Sth").html(Json[Month][Day]);

});


//October $(".October .icon_left").click(function(){

$(".Sth").css({"background":"#87589E","transition":"background 2s"}); $(".September").removeClass("a-fadeout"); $(".October").removeClass("a-fadein"); $(".October").addClass("a-fadeout"); $(".September").addClass("a-fadein"); $(".September").css("display","block"); setTimeout(function(){ $(".October").css("display","none"); },1000);

});

$(".October .icon_right").click(function(){

$(".Sth").css({"background":"#5DA0CA","transition":"background 2s"}); $(".March").removeClass("a-fadeout"); $(".October").removeClass("a-fadein"); $(".October").addClass("a-fadeout"); $(".March").addClass("a-fadein"); $(".March").css("display","block"); setTimeout(function(){ $(".October").css("display","none"); },1000);

});

$(".October .sth").click(function(){

$(".calendar .sth").css({"background":"none","color":"#333333"}); $(".October .day_x:first li").css("color","#75B574"); $(".calendar .sth .focus").css("display","block"); $(this).children().css("display","none"); $(this).css({"background":"#5FA768","color":"white"});

var Month="October"; var Day="D"+String(parseInt($(this).text())); $(".Sth").html(Json[Month][Day]);

});

});