Team:SSTi-SZGD/js/Team

/*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}); }); }

}