Team:Goettingen/suplement/scripts

From 2013.igem.org

(Difference between revisions)
m
m
Line 15: Line 15:
   $(z).mouseleave(function(){$(x).removeClass("deact");$(y).hide();});
   $(z).mouseleave(function(){$(x).removeClass("deact");$(y).hide();});
};
};
 +
 +
//4 pic slides
 +
 +
function fadeInOut()
 +
{
 +
$("#slide").fadeOut(500,function(){
 +
i++;
 +
document.getElementById("slide").src=e[i];
 +
document.getElementById("write").innerHTML = "slide: " + i;
 +
$("#slide").fadeIn(300);
 +
});
 +
 +
}
 +
 +
 +
function starttimer()
 +
{
 +
 +
//document.getElementById("slide").src=e[i];
 +
fadeInOut();
 +
$("#resume").hide();
 +
$("#stop").show();
 +
if(i >= 3) i = 0;
 +
timer=setTimeout("starttimer()",5000);
 +
};
 +
 +
 +
function stoptimer()
 +
{
 +
clearTimeout(timer);
 +
document.getElementById("write").innerHTML = "stopped";
 +
$("#stop").hide();
 +
$("#resume").show();
 +
}
 +
 +
function go2right(){
 +
stoptimer();
 +
starttimer();
 +
}
 +
 +
function go2left(){
 +
stoptimer();
 +
if (i == 0) i = 3;
 +
i = i - 2;
 +
if (i < 0) i =2;
 +
starttimer();
 +
}

Revision as of 19:22, 9 June 2013

//universal

 $(".f-larger").click(function(){
   $("p").css("font-size","14pt");
 });
 $(".f-smaller").click(function(){
   $("p").css("font-size","12pt");
 });
 $(".f-medium").click(function(){
   $("p").css("font-size","13pt");
 });

function proFlyout(which){

 var x="."+which,y=".f-"+which,z="#id-"+which;
 $(z).mouseenter(function(){$(y).fadeIn();$(x).addClass("deact");});
 $(z).mouseleave(function(){$(x).removeClass("deact");$(y).hide();});

};

//4 pic slides

function fadeInOut() { $("#slide").fadeOut(500,function(){ i++; document.getElementById("slide").src=e[i]; document.getElementById("write").innerHTML = "slide: " + i; $("#slide").fadeIn(300); });

}


function starttimer() {

//document.getElementById("slide").src=e[i]; fadeInOut(); $("#resume").hide(); $("#stop").show(); if(i >= 3) i = 0; timer=setTimeout("starttimer()",5000); };


function stoptimer() { clearTimeout(timer); document.getElementById("write").innerHTML = "stopped"; $("#stop").hide(); $("#resume").show(); }

function go2right(){ stoptimer(); starttimer(); }

function go2left(){ stoptimer(); if (i == 0) i = 3; i = i - 2; if (i < 0) i =2; starttimer(); }