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

Line 11: Line 11:
  
  
/*延时加载*/
+
/*轮播*/
 
$(function(){
 
$(function(){
 
 
var winHeight=$(window).height();
+
//public
var RebekahTop=$(".Rebekah").parent().offset().top-$(window).scrollTop();
+
var scrollLenth=$(".Content ul").outerWidth();
var RichardTop=$(".Richard").parent().offset().top-$(window).scrollTop();
+
$(".Content ul").css("left",-scrollLenth*0.11);
var JoyceTop=$(".Joyce").parent().offset().top-$(window).scrollTop();
+
 
var BobTop=$(".Bob").parent().offset().top-$(window).scrollTop();
+
//Students
var CarolTop=$(".Carol").parent().offset().top-$(window).scrollTop();
+
$(".Content .Students .scroll").hover(function(){
var LindaTop=$(".Linda").parent().offset().top-$(window).scrollTop();
+
 
var YolandaTop=$(".Yolanda").parent().offset().top-$(window).scrollTop();
+
clearInterval(Students_Time);
var JasmineTop=$(".Jasmine").parent().offset().top-$(window).scrollTop();
+
var VivianTop=$(".Vivian").parent().offset().top-$(window).scrollTop();
+
},function(){
var LuckyTop=$(".Lucky").parent().offset().top-$(window).scrollTop();
+
var KennyTop=$(".Kenny").parent().offset().top-$(window).scrollTop();
+
Students_Time=setInterval("Students_ScrollRight()",3000);
var Ying_PengTop=$(".Ying_Peng").parent().offset().top-$(window).scrollTop();
+
var Jianglin_YuTop=$(".Jianglin_Yu").parent().offset().top-$(window).scrollTop();
+
});
var Shuqiao_YuTop=$(".Shuqiao_Yu").parent().offset().top-$(window).scrollTop();
+
var Zhaoying_GuanTop=$(".Zhaoying_Guan").parent().offset().top-$(window).scrollTop();
+
 
 
if(RebekahTop<winHeight-100){
+
$(".Content .Students .icon_left").click(function(){
setTimeout(function(){
+
Students_ScrollLeft();
$(".Rebekah").addClass("a-fadein");
+
});
$(".Rebekah").css("display","block");
+
},150);
+
}
+
if(RichardTop<winHeight-100){
+
setTimeout(function(){
+
$(".Richard").addClass("a-fadein");
+
$(".Richard").css("display","block");
+
},150);
+
}
+
if(JoyceTop<winHeight-100){
+
setTimeout(function(){
+
$(".Joyce").addClass("a-fadein");
+
$(".Joyce").css("display","block");
+
},150);
+
}
+
if(BobTop<winHeight-100){
+
setTimeout(function(){
+
$(".Bob").addClass("a-fadein");
+
$(".Bob").css("display","block");
+
},150);
+
}
+
if(CarolTop<winHeight-100){
+
setTimeout(function(){
+
$(".Carol").addClass("a-fadein");
+
$(".Carol").css("display","block");
+
},150);
+
}
+
if(LindaTop<winHeight-100){
+
setTimeout(function(){
+
$(".Linda").addClass("a-fadein");
+
$(".Linda").css("display","block");
+
},150);
+
}
+
if(YolandaTop<winHeight-100){
+
setTimeout(function(){
+
$(".Yolanda").addClass("a-fadein");
+
$(".Yolanda").css("display","block");
+
},150);
+
}
+
if(JasmineTop<winHeight-100){
+
setTimeout(function(){
+
$(".Jasmine").addClass("a-fadein");
+
$(".Jasmine").css("display","block");
+
},150);
+
}
+
if(VivianTop<winHeight-100){
+
setTimeout(function(){
+
$(".Vivian").addClass("a-fadein");
+
$(".Vivian").css("display","block");
+
},150);
+
}
+
if(LuckyTop<winHeight-100){
+
setTimeout(function(){
+
$(".Lucky").addClass("a-fadein");
+
$(".Lucky").css("display","block");
+
},150);
+
}
+
if(KennyTop<winHeight-100){
+
setTimeout(function(){
+
$(".Kenny").addClass("a-fadein");
+
$(".Kenny").css("display","block");
+
},150);
+
}
+
if(Ying_PengTop<winHeight-100){
+
setTimeout(function(){
+
$(".Ying_Peng").addClass("a-fadein");
+
$(".Ying_Peng").css("display","block");
+
},150);
+
}
+
if(Jianglin_YuTop<winHeight-100){
+
setTimeout(function(){
+
$(".Jianglin_Yu").addClass("a-fadein");
+
$(".Jianglin_Yu").css("display","block");
+
},150);
+
}
+
if(Shuqiao_YuTop<winHeight-100){
+
setTimeout(function(){
+
$(".Shuqiao_Yu").addClass("a-fadein");
+
$(".Shuqiao_Yu").css("display","block");
+
},150);
+
}
+
if(Zhaoying_GuanTop<winHeight-100){
+
setTimeout(function(){
+
$(".Zhaoying_Guan").addClass("a-fadein");
+
$(".Zhaoying_Guan").css("display","block");
+
},150);
+
}
+
 
 
$(window).scroll(function(){
+
$(".Content .Students .icon_right").click(function(){
 +
Students_ScrollRight();
 +
});
 +
 +
//Teachers
 +
$(".Content .Teachers .scroll").hover(function(){
 +
 
 +
clearInterval(Teachers_Time);
 
 
winHeight=$(window).height();
+
},function(){
RebekahTop=$(".Rebekah").parent().offset().top-$(window).scrollTop();
+
RichardTop=$(".Richard").parent().offset().top-$(window).scrollTop();
+
JoyceTop=$(".Joyce").parent().offset().top-$(window).scrollTop();
+
BobTop=$(".Bob").parent().offset().top-$(window).scrollTop();
+
CarolTop=$(".Carol").parent().offset().top-$(window).scrollTop();
+
LindaTop=$(".Linda").parent().offset().top-$(window).scrollTop();
+
YolandaTop=$(".Yolanda").parent().offset().top-$(window).scrollTop();
+
JasmineTop=$(".Jasmine").parent().offset().top-$(window).scrollTop();
+
VivianTop=$(".Vivian").parent().offset().top-$(window).scrollTop();
+
LuckyTop=$(".Lucky").parent().offset().top-$(window).scrollTop();
+
KennyTop=$(".Kenny").parent().offset().top-$(window).scrollTop();
+
Ying_PengTop=$(".Ying_Peng").parent().offset().top-$(window).scrollTop();
+
Jianglin_YuTop=$(".Jianglin_Yu").parent().offset().top-$(window).scrollTop();
+
Shuqiao_YuTop=$(".Shuqiao_Yu").parent().offset().top-$(window).scrollTop();
+
Zhaoying_GuanTop=$(".Zhaoying_Guan").parent().offset().top-$(window).scrollTop();
+
 
 
if(RebekahTop<winHeight-100){
+
Teachers_Time=setInterval("Teachers_ScrollRight()",3000);
setTimeout(function(){
+
$(".Rebekah").addClass("a-fadein");
+
$(".Rebekah").css("display","block");
+
},150);
+
}
+
if(RichardTop<winHeight-100){
+
setTimeout(function(){
+
$(".Richard").addClass("a-fadein");
+
$(".Richard").css("display","block");
+
},150);
+
}
+
if(JoyceTop<winHeight-100){
+
setTimeout(function(){
+
$(".Joyce").addClass("a-fadein");
+
$(".Joyce").css("display","block");
+
},150);
+
}
+
if(BobTop<winHeight-100){
+
setTimeout(function(){
+
$(".Bob").addClass("a-fadein");
+
$(".Bob").css("display","block");
+
},150);
+
}
+
if(CarolTop<winHeight-100){
+
setTimeout(function(){
+
$(".Carol").addClass("a-fadein");
+
$(".Carol").css("display","block");
+
},150);
+
}
+
if(LindaTop<winHeight-100){
+
setTimeout(function(){
+
$(".Linda").addClass("a-fadein");
+
$(".Linda").css("display","block");
+
},150);
+
}
+
if(YolandaTop<winHeight-100){
+
setTimeout(function(){
+
$(".Yolanda").addClass("a-fadein");
+
$(".Yolanda").css("display","block");
+
},150);
+
}
+
if(JasmineTop<winHeight-100){
+
setTimeout(function(){
+
$(".Jasmine").addClass("a-fadein");
+
$(".Jasmine").css("display","block");
+
},150);
+
}
+
if(VivianTop<winHeight-100){
+
setTimeout(function(){
+
$(".Vivian").addClass("a-fadein");
+
$(".Vivian").css("display","block");
+
},150);
+
}
+
if(LuckyTop<winHeight-100){
+
setTimeout(function(){
+
$(".Lucky").addClass("a-fadein");
+
$(".Lucky").css("display","block");
+
},150);
+
}
+
if(KennyTop<winHeight-100){
+
setTimeout(function(){
+
$(".Kenny").addClass("a-fadein");
+
$(".Kenny").css("display","block");
+
},150);
+
}
+
if(Ying_PengTop<winHeight-100){
+
setTimeout(function(){
+
$(".Ying_Peng").addClass("a-fadein");
+
$(".Ying_Peng").css("display","block");
+
},150);
+
}
+
if(Jianglin_YuTop<winHeight-100){
+
setTimeout(function(){
+
$(".Jianglin_Yu").addClass("a-fadein");
+
$(".Jianglin_Yu").css("display","block");
+
},150);
+
}
+
if(Shuqiao_YuTop<winHeight-100){
+
setTimeout(function(){
+
$(".Shuqiao_Yu").addClass("a-fadein");
+
$(".Shuqiao_Yu").css("display","block");
+
},150);
+
}
+
if(Zhaoying_GuanTop<winHeight-100){
+
setTimeout(function(){
+
$(".Zhaoying_Guan").addClass("a-fadein");
+
$(".Zhaoying_Guan").css("display","block");
+
},150);
+
}
+
 
 
 
});
 
});
 +
 +
$(".Content .Teachers .icon_left").click(function(){
 +
Teachers_ScrollLeft();
 +
});
 +
 +
$(".Content .Teachers .icon_right").click(function(){
 +
Teachers_ScrollRight();
 +
});
 
 
 
});
 
});
 +
 +
var Students_Time=setInterval("Students_ScrollRight()",3000);
 +
var Teachers_Time=setInterval("Teachers_ScrollRight()",3000);
 +
 +
//Students
 +
function Students_ScrollLeft(){
 +
 +
var scrollLenth=$(".Content .Students ul").outerWidth();
 +
$(".Content .Students  ul").stop().animate({"left":"0px"},500,function(){
 +
$(".Content .Students  ul").prepend($(".Content .Students  ul li:last"));
 +
$(".Content .Students  ul").css({"left":-scrollLenth*0.11});
 +
});
 +
 +
}
 +
 +
function Students_ScrollRight(){
 +
 +
var scrollLenth=$(".Content .Students  ul").outerWidth();
 +
$(".Content .Students  ul").stop().animate({"left":-scrollLenth*0.11*2},500,function(){
 +
$(".Content .Students  ul").append($(".Content .Students  ul li:first"));
 +
$(".Content .Students  ul").css({"left":-scrollLenth*0.11});
 +
});
 +
 +
}
 +
 +
//Teachers
 +
function Teachers_ScrollLeft(){
 +
 +
var scrollLenth=$(".Content .Teachers ul").outerWidth();
 +
$(".Content .Teachers  ul").stop().animate({"left":"0px"},500,function(){
 +
$(".Content .Teachers  ul").prepend($(".Content .Teachers  ul li:last"));
 +
$(".Content .Teachers  ul").css({"left":-scrollLenth*0.11});
 +
});
 +
 +
}
 +
 +
function Teachers_ScrollRight(){
 +
 +
var scrollLenth=$(".Content .Teachers  ul").outerWidth();
 +
$(".Content .Teachers  ul").stop().animate({"left":-scrollLenth*0.11*2},500,function(){
 +
$(".Content .Teachers  ul").append($(".Content .Teachers  ul li:first"));
 +
$(".Content .Teachers  ul").css({"left":-scrollLenth*0.11});
 +
});
 +
 +
}

Revision as of 01:22, 6 September 2017

/*自定义Team效果*/ $(function(){

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

});


/*轮播*/ $(function(){

//public var scrollLenth=$(".Content ul").outerWidth(); $(".Content ul").css("left",-scrollLenth*0.11);

//Students $(".Content .Students .scroll").hover(function(){

clearInterval(Students_Time);

},function(){

Students_Time=setInterval("Students_ScrollRight()",3000);

});

$(".Content .Students .icon_left").click(function(){ Students_ScrollLeft(); });

$(".Content .Students .icon_right").click(function(){ Students_ScrollRight(); });

//Teachers $(".Content .Teachers .scroll").hover(function(){

clearInterval(Teachers_Time);

},function(){

Teachers_Time=setInterval("Teachers_ScrollRight()",3000);

});

$(".Content .Teachers .icon_left").click(function(){ Teachers_ScrollLeft(); });

$(".Content .Teachers .icon_right").click(function(){ Teachers_ScrollRight(); });

});

var Students_Time=setInterval("Students_ScrollRight()",3000); var Teachers_Time=setInterval("Teachers_ScrollRight()",3000);

//Students function Students_ScrollLeft(){

var scrollLenth=$(".Content .Students ul").outerWidth(); $(".Content .Students ul").stop().animate({"left":"0px"},500,function(){ $(".Content .Students ul").prepend($(".Content .Students ul li:last")); $(".Content .Students ul").css({"left":-scrollLenth*0.11}); });

}

function Students_ScrollRight(){

var scrollLenth=$(".Content .Students ul").outerWidth(); $(".Content .Students ul").stop().animate({"left":-scrollLenth*0.11*2},500,function(){ $(".Content .Students ul").append($(".Content .Students ul li:first")); $(".Content .Students ul").css({"left":-scrollLenth*0.11}); });

}

//Teachers function Teachers_ScrollLeft(){

var scrollLenth=$(".Content .Teachers ul").outerWidth(); $(".Content .Teachers ul").stop().animate({"left":"0px"},500,function(){ $(".Content .Teachers ul").prepend($(".Content .Teachers ul li:last")); $(".Content .Teachers ul").css({"left":-scrollLenth*0.11}); });

}

function Teachers_ScrollRight(){

var scrollLenth=$(".Content .Teachers ul").outerWidth(); $(".Content .Teachers ul").stop().animate({"left":-scrollLenth*0.11*2},500,function(){ $(".Content .Teachers ul").append($(".Content .Teachers ul li:first")); $(".Content .Teachers ul").css({"left":-scrollLenth*0.11}); });

}