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

Line 1: Line 1:
/*自定义Team效果*/
+
/*custom Team Effect*/
 
$(function(){
 
$(function(){
 
 
Line 11: Line 11:
  
  
/*轮播*/
+
/*Carousel*/
 
$(function(){
 
$(function(){
 
 
//Students
+
//Team_Member
$(".Content .Students .scroll").hover(function(){
+
$(".Content .Team_Member .scroll").hover(function(){
  
clearInterval(Students_Time);
+
clearInterval(Team_Member_Time);
 
 
 
},function(){
 
},function(){
 
 
Students_Time=setInterval("Students_ScrollRight()",3000);
+
Team_Member_Time=setInterval("Team_Member_ScrollRight()",3000);
 
 
 
});
 
});
 
 
$(".Content .Students .icon_left").click(function(){
+
$(".Content .Team_Member .icon_left").click(function(){
Students_ScrollLeft();
+
Team_Member_ScrollLeft();
 
});
 
});
 
 
$(".Content .Students .icon_right").click(function(){
+
$(".Content .Team_Member .icon_right").click(function(){
Students_ScrollRight();
+
Team_Member_ScrollRight();
 
});
 
});
 
 
//Teachers
+
//Instructor
$(".Content .Teachers .scroll").hover(function(){
+
$(".Content .Instructor .scroll").hover(function(){
  
clearInterval(Teachers_Time);
+
clearInterval(Instructor_Time);
 
 
 
},function(){
 
},function(){
 
 
Teachers_Time=setInterval("Teachers_ScrollRight()",3000);
+
Instructor_Time=setInterval("Instructor_ScrollRight()",3000);
 
 
 
});
 
});
 
 
$(".Content .Teachers .icon_left").click(function(){
+
$(".Content .Instructor .icon_left").click(function(){
Teachers_ScrollLeft();
+
Instructor_ScrollLeft();
 
});
 
});
 
 
$(".Content .Teachers .icon_right").click(function(){
+
$(".Content .Instructor .icon_right").click(function(){
Teachers_ScrollRight();
+
Instructor_ScrollRight();
 
});
 
});
 
 
Line 55: Line 55:
 
});
 
});
  
var Students_Time=setInterval("Students_ScrollRight()",3000);
+
var Team_Member_Time=setInterval("Team_Member_ScrollRight()",3000);
var Teachers_Time=setInterval("Teachers_ScrollRight()",3000);
+
var Instructor_Time=setInterval("Instructor_ScrollRight()",3000);
  
//Students
+
//Team_Member
function Students_ScrollLeft(){
+
function Team_Member_ScrollLeft(){
 
 
 
var scrollLenth=$(".Content ul").position().left;
 
var scrollLenth=$(".Content ul").position().left;
$(".Content .Students ul").stop().animate({"left":"0px"},500,function(){
+
$(".Content .Team_Member ul").stop().animate({"left":"0px"},500,function(){
$(".Content .Students ul").prepend($(".Content .Students ul li:last"));
+
$(".Content .Team_Member ul").prepend($(".Content .Team_Member ul li:last"));
$(".Content .Students ul").css({"left":scrollLenth});
+
$(".Content .Team_Member ul").css({"left":scrollLenth});
 
});
 
});
 
 
 
}
 
}
  
function Students_ScrollRight(){
+
function Team_Member_ScrollRight(){
 
 
 
var scrollLenth=$(".Content ul").position().left;
 
var scrollLenth=$(".Content ul").position().left;
  
 
if(scrollLenth=="-507"){
 
if(scrollLenth=="-507"){
$(".Content .Students ul").stop().animate({"left":"-1014px"},500,function(){
+
$(".Content .Team_Member ul").stop().animate({"left":"-1014px"},500,function(){
$(".Content .Students ul").append($(".Content .Students ul li:first"));
+
$(".Content .Team_Member ul").append($(".Content .Team_Member ul li:first"));
$(".Content .Students ul").css({"left":scrollLenth});
+
$(".Content .Team_Member  ul").css({"left":scrollLenth});
 +
});
 +
}
 +
else if(scrollLenth=="-539"){
 +
$(".Content .Team_Member  ul").stop().animate({"left":"-1078px"},500,function(){
 +
$(".Content .Team_Member  ul").append($(".Content .Team_Member ul li:first"));
 +
$(".Content .Team_Member ul").css({"left":scrollLenth});
 
});
 
});
 
}
 
}
 
else if(scrollLenth=="-450"){
 
else if(scrollLenth=="-450"){
$(".Content .Students ul").stop().animate({"left":"-900px"},500,function(){
+
$(".Content .Team_Member ul").stop().animate({"left":"-900px"},500,function(){
$(".Content .Students ul").append($(".Content .Students ul li:first"));
+
$(".Content .Team_Member ul").append($(".Content .Team_Member ul li:first"));
$(".Content .Students ul").css({"left":scrollLenth});
+
$(".Content .Team_Member ul").css({"left":scrollLenth});
 
});
 
});
 
}
 
}
 
else{
 
else{
$(".Content .Students ul").stop().animate({"left":"-1660px"},500,function(){
+
$(".Content .Team_Member ul").stop().animate({"left":"-1660px"},500,function(){
$(".Content .Students ul").append($(".Content .Students ul li:first"));
+
$(".Content .Team_Member ul").append($(".Content .Team_Member ul li:first"));
$(".Content .Students ul").css({"left":scrollLenth});
+
$(".Content .Team_Member ul").css({"left":scrollLenth});
 
});
 
});
 
}
 
}
Line 94: Line 100:
 
}
 
}
  
//Teachers
+
//Instructor
function Teachers_ScrollLeft(){
+
function Instructor_ScrollLeft(){
 
 
 
var scrollLenth=$(".Content ul").position().left;
 
var scrollLenth=$(".Content ul").position().left;
$(".Content .Teachers ul").stop().animate({"left":"0px"},500,function(){
+
$(".Content .Instructor ul").stop().animate({"left":"0px"},500,function(){
$(".Content .Teachers ul").prepend($(".Content .Teachers ul li:last"));
+
$(".Content .Instructor ul").prepend($(".Content .Instructor ul li:last"));
$(".Content .Teachers ul").css({"left":scrollLenth});
+
$(".Content .Instructor ul").css({"left":scrollLenth});
 
});
 
});
 
 
 
}
 
}
  
function Teachers_ScrollRight(){
+
function Instructor_ScrollRight(){
 
 
 
var scrollLenth=$(".Content ul").position().left;
 
var scrollLenth=$(".Content ul").position().left;
  
 
if(scrollLenth=="-507"){
 
if(scrollLenth=="-507"){
$(".Content .Teachers ul").stop().animate({"left":"-1014px"},500,function(){
+
$(".Content .Instructor ul").stop().animate({"left":"-1014px"},500,function(){
$(".Content .Teachers ul").append($(".Content .Teachers ul li:first"));
+
$(".Content .Instructor ul").append($(".Content .Instructor ul li:first"));
$(".Content .Teachers ul").css({"left":scrollLenth});
+
$(".Content .Instructor  ul").css({"left":scrollLenth});
 +
});
 +
}
 +
else if(scrollLenth=="-539"){
 +
$(".Content .Instructor  ul").stop().animate({"left":"-1078px"},500,function(){
 +
$(".Content .Instructor  ul").append($(".Content .Instructor ul li:first"));
 +
$(".Content .Instructor ul").css({"left":scrollLenth});
 
});
 
});
 
}
 
}
 
else if(scrollLenth=="-450"){
 
else if(scrollLenth=="-450"){
$(".Content .Teachers ul").stop().animate({"left":"-900px"},500,function(){
+
$(".Content .Instructor ul").stop().animate({"left":"-900px"},500,function(){
$(".Content .Teachers ul").append($(".Content .Teachers ul li:first"));
+
$(".Content .Instructor ul").append($(".Content .Instructor ul li:first"));
$(".Content .Teachers ul").css({"left":scrollLenth});
+
$(".Content .Instructor ul").css({"left":scrollLenth});
 
});
 
});
 
}
 
}
 
else{
 
else{
$(".Content .Teachers ul").stop().animate({"left":"-1660px"},500,function(){
+
$(".Content .Instructor ul").stop().animate({"left":"-1660px"},500,function(){
$(".Content .Teachers ul").append($(".Content .Teachers ul li:first"));
+
$(".Content .Instructor ul").append($(".Content .Instructor ul li:first"));
$(".Content .Teachers ul").css({"left":scrollLenth});
+
$(".Content .Instructor ul").css({"left":scrollLenth});
 
});
 
});
 
}
 
}
 
 
 
}
 
}

Revision as of 17:44, 23 September 2017

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

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

});


/*Carousel*/ $(function(){

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

clearInterval(Team_Member_Time);

},function(){

Team_Member_Time=setInterval("Team_Member_ScrollRight()",3000);

});

$(".Content .Team_Member .icon_left").click(function(){ Team_Member_ScrollLeft(); });

$(".Content .Team_Member .icon_right").click(function(){ Team_Member_ScrollRight(); });

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

clearInterval(Instructor_Time);

},function(){

Instructor_Time=setInterval("Instructor_ScrollRight()",3000);

});

$(".Content .Instructor .icon_left").click(function(){ Instructor_ScrollLeft(); });

$(".Content .Instructor .icon_right").click(function(){ Instructor_ScrollRight(); });


});

var Team_Member_Time=setInterval("Team_Member_ScrollRight()",3000); var Instructor_Time=setInterval("Instructor_ScrollRight()",3000);

//Team_Member function Team_Member_ScrollLeft(){

var scrollLenth=$(".Content ul").position().left; $(".Content .Team_Member ul").stop().animate({"left":"0px"},500,function(){ $(".Content .Team_Member ul").prepend($(".Content .Team_Member ul li:last")); $(".Content .Team_Member ul").css({"left":scrollLenth}); });

}

function Team_Member_ScrollRight(){

var scrollLenth=$(".Content ul").position().left;

if(scrollLenth=="-507"){ $(".Content .Team_Member ul").stop().animate({"left":"-1014px"},500,function(){ $(".Content .Team_Member ul").append($(".Content .Team_Member ul li:first")); $(".Content .Team_Member ul").css({"left":scrollLenth}); }); } else if(scrollLenth=="-539"){ $(".Content .Team_Member ul").stop().animate({"left":"-1078px"},500,function(){ $(".Content .Team_Member ul").append($(".Content .Team_Member ul li:first")); $(".Content .Team_Member ul").css({"left":scrollLenth}); }); } else if(scrollLenth=="-450"){ $(".Content .Team_Member ul").stop().animate({"left":"-900px"},500,function(){ $(".Content .Team_Member ul").append($(".Content .Team_Member ul li:first")); $(".Content .Team_Member ul").css({"left":scrollLenth}); }); } else{ $(".Content .Team_Member ul").stop().animate({"left":"-1660px"},500,function(){ $(".Content .Team_Member ul").append($(".Content .Team_Member ul li:first")); $(".Content .Team_Member ul").css({"left":scrollLenth}); }); }

}

//Instructor function Instructor_ScrollLeft(){

var scrollLenth=$(".Content ul").position().left; $(".Content .Instructor ul").stop().animate({"left":"0px"},500,function(){ $(".Content .Instructor ul").prepend($(".Content .Instructor ul li:last")); $(".Content .Instructor ul").css({"left":scrollLenth}); });

}

function Instructor_ScrollRight(){

var scrollLenth=$(".Content ul").position().left;

if(scrollLenth=="-507"){ $(".Content .Instructor ul").stop().animate({"left":"-1014px"},500,function(){ $(".Content .Instructor ul").append($(".Content .Instructor ul li:first")); $(".Content .Instructor ul").css({"left":scrollLenth}); }); } else if(scrollLenth=="-539"){ $(".Content .Instructor ul").stop().animate({"left":"-1078px"},500,function(){ $(".Content .Instructor ul").append($(".Content .Instructor ul li:first")); $(".Content .Instructor ul").css({"left":scrollLenth}); }); } else if(scrollLenth=="-450"){ $(".Content .Instructor ul").stop().animate({"left":"-900px"},500,function(){ $(".Content .Instructor ul").append($(".Content .Instructor ul li:first")); $(".Content .Instructor ul").css({"left":scrollLenth}); }); } else{ $(".Content .Instructor ul").stop().animate({"left":"-1660px"},500,function(){ $(".Content .Instructor ul").append($(".Content .Instructor ul li:first")); $(".Content .Instructor ul").css({"left":scrollLenth}); }); }

}