/***************************/ //@Author: Adrian "yEnS" Mato Gondelle & Ivan Guardado Castro //@website: www.yensdesign.com //@email: yensamg@gmail.com //@license: Feel free to use it, but keep this credits please! /***************************/ $(document).ready(function(){ var show = function(i) { //change status & style menu var j=0; for (j=0;j<=10;j++) { $("#ph"+j+"").removeClass("active"); $("div.p"+j+"").css("display", "none"); } $("#ph"+i+"").addClass("active"); $("div.p"+i+"").fadeIn(); return false; } $(".photo-tabs > li").click(function(e){ switch(e.target.id){ case "righttab": if (active=="true") { active="false"; $("#righttab").css("background","url(http://deltataudelta.case.edu/wp-content/themes/fb-delt/play.png) no-repeat 6px 3px #efefef");} else { active="true"; $("#righttab").css("background","url(http://deltataudelta.case.edu/wp-content/themes/fb-delt/pause.png) no-repeat 6px 3px #efefef");} break; case "ph1": show(1);b=2; active="false";$("#righttab").css("background","url(http://deltataudelta.case.edu/wp-content/themes/fb-delt/play.png) no-repeat 6px 3px #efefef"); break; case "ph2": show(2);b=3; active="false";$("#righttab").css("background","url(http://deltataudelta.case.edu/wp-content/themes/fb-delt/play.png) no-repeat 6px 3px #efefef"); break; case "ph3": show(3);b=4; active=false;$("#righttab").css("background","url(http://deltataudelta.case.edu/wp-content/themes/fb-delt/play.png) no-repeat 6px 3px #efefef"); break; case "ph4": show(4);b=5; active="false";$("#righttab").css("background","url(http://deltataudelta.case.edu/wp-content/themes/fb-delt/play.png) no-repeat 6px 3px #efefef"); break; case "ph5": show(5);$("#righttab").css("background","url(http://deltataudelta.case.edu/wp-content/themes/fb-delt/play.png) no-repeat 6px 3px #efefef"); active="false";b=6; break; case "ph6": show(6);b=7; active="false";$("#righttab").css("background","url(http://deltataudelta.case.edu/wp-content/themes/fb-delt/play.png) no-repeat 6px 3px #efefef"); break; case "ph7": show(7);b=8; active="false";$("#righttab").css("background","url(http://deltataudelta.case.edu/wp-content/themes/fb-delt/play.png) no-repeat 6px 3px #efefef"); break; case "ph8": show(8);b=9; active="false";$("#righttab").css("background","url(http://deltataudelta.case.edu/wp-content/themes/fb-delt/play.png) no-repeat 6px 3px #efefef"); break; case "ph9": show(9);b=10; active="false";$("#righttab").css("background","url(http://deltataudelta.case.edu/wp-content/themes/fb-delt/play.png) no-repeat 6px 3px #efefef"); break; case "ph10": show(10);b=1; active="false";$("#righttab").css("background","url(http://deltataudelta.case.edu/wp-content/themes/fb-delt/play.png) no-repeat 6px 3px #efefef"); break; } //alert(e.target.id); return false; }); var b=2; var active="true"; var demos = $("div.demos"); $(".uncontrolled-interval", demos).everyTime(8000,function(i) { if (active=="true") { if (b==7) b=1; if (b==1) show(1); if (b==2) show(2); if (b==3) show(3); if (b==4) show(4); if (b==5) show(5); if (b==6) show(6); if (b==7) show(7); if (b==8) show(8); if (b==9) show(9); if (b==10) show(10); b++; } }); });