Team:Goettingen/suplement/scripts
From 2013.igem.org
m |
m |
||
Line 9: | Line 9: | ||
$("p").css("font-size","13pt"); | $("p").css("font-size","13pt"); | ||
}); | }); | ||
+ | function proFlyout(which){ | ||
+ | var x="."+which,y=".f-"+which,z="#id-"+which,w = 'id-' + which; | ||
+ | var left = document.getElementsByClassName(which)[0].offsetLeft - document.getElementById('id-' + which).offsetParent.firstElementChild.offsetLeft - 4; | ||
+ | $(z).mouseenter(function(){ | ||
+ | $(y).fadeIn("fast"); | ||
+ | var test; | ||
+ | document.getElementsByClassName('f-'+which)[0].style.left = left + 'px'; | ||
+ | //alert(document.getElementsByClassName('f-'+which)[0].style.left); | ||
+ | $(x).addClass("deact"); | ||
+ | }); | ||
+ | $(z).mouseleave(function(){$(x).removeClass("deact");$(y).hide();}); | ||
+ | }; | ||
+ | |||
+ | //4 slides | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
function fadeInOut() | function fadeInOut() | ||
{ | { | ||
- | $("#slide").fadeOut( | + | $("#slide").fadeOut(300,function(){ |
i++; | i++; | ||
document.getElementById("slide").src=e[i]; | document.getElementById("slide").src=e[i]; | ||
document.getElementById("write").innerHTML = "slide: " + i; | document.getElementById("write").innerHTML = "slide: " + i; | ||
- | $("#slide").fadeIn(300); | + | $("#slide").fadeIn(300,slide_ctrl()); |
}); | }); | ||
} | } | ||
+ | |||
+ | |||
Line 35: | Line 44: | ||
//document.getElementById("slide").src=e[i]; | //document.getElementById("slide").src=e[i]; | ||
fadeInOut(); | fadeInOut(); | ||
+ | //header_dots(); | ||
$("#resume").hide(); | $("#resume").hide(); | ||
$("#stop").show(); | $("#stop").show(); | ||
if(i >= 3) i = 0; | if(i >= 3) i = 0; | ||
- | timer=setTimeout("starttimer()",5000); | + | timer = setTimeout("starttimer()",5000); |
}; | }; | ||
Line 46: | Line 56: | ||
clearTimeout(timer); | clearTimeout(timer); | ||
document.getElementById("write").innerHTML = "stopped"; | document.getElementById("write").innerHTML = "stopped"; | ||
- | $("# | + | $("#pause").hide(); |
$("#resume").show(); | $("#resume").show(); | ||
} | } | ||
Line 53: | Line 63: | ||
stoptimer(); | stoptimer(); | ||
starttimer(); | starttimer(); | ||
+ | } | ||
+ | |||
+ | function slide_ctrl(){ | ||
+ | var x = 0; | ||
+ | var text = '<img src="goe-left.png" alt="previous" id="left" onclick="go2left()" />'; | ||
+ | for(x=0;x<=2;x++){ | ||
+ | if (x==(i-1)) { text += '<img src="goe-this.png" />' ;} | ||
+ | else { text += '<img src="goe-notThis.png" onclick="i = ' + x + ';stoptimer(); starttimer()" />';} | ||
+ | }; | ||
+ | text += '<img src="goe-right.png" alt="next" id="right" onclick="go2right()" />'; | ||
+ | text += '<img src="goe-pause.png" alt="pause" id="pause" onclick="stoptimer()" /><img src="goe-resume.png" alt="resume" id="resume" onclick="starttimer()" style="display:none" />'; | ||
+ | //else {text += '';} | ||
+ | //alert(timer > 0); | ||
+ | document.getElementById("slide-ctrl").innerHTML = text; | ||
} | } | ||
Revision as of 10:15, 11 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,w = 'id-' + which; var left = document.getElementsByClassName(which)[0].offsetLeft - document.getElementById('id-' + which).offsetParent.firstElementChild.offsetLeft - 4; $(z).mouseenter(function(){ $(y).fadeIn("fast"); var test; document.getElementsByClassName('f-'+which)[0].style.left = left + 'px'; //alert(document.getElementsByClassName('f-'+which)[0].style.left); $(x).addClass("deact"); }); $(z).mouseleave(function(){$(x).removeClass("deact");$(y).hide();}); };
//4 slides
function fadeInOut()
{
$("#slide").fadeOut(300,function(){
i++;
document.getElementById("slide").src=e[i];
document.getElementById("write").innerHTML = "slide: " + i;
$("#slide").fadeIn(300,slide_ctrl());
});
}
function starttimer()
{
//document.getElementById("slide").src=e[i]; fadeInOut(); //header_dots(); $("#resume").hide(); $("#stop").show(); if(i >= 3) i = 0; timer = setTimeout("starttimer()",5000); };
function stoptimer()
{
clearTimeout(timer);
document.getElementById("write").innerHTML = "stopped";
$("#pause").hide();
$("#resume").show();
}
function go2right(){ stoptimer(); starttimer(); }
function slide_ctrl(){
var x = 0;
var text = '<img src="goe-left.png" alt="previous" id="left" onclick="go2left()" />'; for(x=0;x<=2;x++){ if (x==(i-1)) { text += '<img src="goe-this.png" />' ;} else { text += '<img src="goe-notThis.png" onclick="i = ' + x + ';stoptimer(); starttimer()" />';} }; text += '<img src="goe-right.png" alt="next" id="right" onclick="go2right()" />'; text += '<img src="goe-pause.png" alt="pause" id="pause" onclick="stoptimer()" /><img src="goe-resume.png" alt="resume" id="resume" onclick="starttimer()" style="display:none" />'; //else {text += ;} //alert(timer > 0); document.getElementById("slide-ctrl").innerHTML = text; }
function go2left(){ stoptimer(); if (i == 0) i = 3; i = i - 2; if (i < 0) i =2; starttimer(); }