Team:Goettingen/suplement/scripts

From 2013.igem.org

(Difference between revisions)
 
(19 intermediate revisions not shown)
Line 8: Line 8:
//alert(sib);
//alert(sib);
-
sib.style.top = calDefTop(par) + par.clientHeight + 'px';
+
sib.style.top = calDefTop(par) + par.clientHeight -1 + 'px';
sib.style.left = ob.offsetLeft + 'px';
sib.style.left = ob.offsetLeft + 'px';
Line 19: Line 19:
}
}
 +
 +
//与jq中的toggle函数相似,简化版本
 +
function toggle(target){
 +
  if(getComputedStyle(target,null).display == "none"){
 +
            target.style.display = "block"
 +
    } else {target.style.display = "none"}
 +
}
 +
 +
function getOrgStyle(ob){
function getOrgStyle(ob){
Line 47: Line 56:
function startslide()
function startslide()
{
{
-
if(picSlide_i >= 3) picSlide_i = 0;
+
if(picSlide_i >= e.length) picSlide_i = 0;
fadeInOut();
fadeInOut();
$("#resume").hide();
$("#resume").hide();
Line 69: Line 78:
     var x = 0;
     var x = 0;
var text = '<span id="slide-ctrl-1">';
var text = '<span id="slide-ctrl-1">';
-
for(x=0;x<=2;x++){
+
for(x=0;x<e.length;x++){
if (x==(picSlide_i-1)) { text += '<img src="https://static.igem.org/mediawiki/2013/9/9d/Goe-this.png" />' ;}
if (x==(picSlide_i-1)) { text += '<img src="https://static.igem.org/mediawiki/2013/9/9d/Goe-this.png" />' ;}
else { text += '<img src="https://static.igem.org/mediawiki/2013/4/4c/Goe-notThis.png" onclick="picSlide_i = ' + x + ';stopslide(); startslide()" />';}
else { text += '<img src="https://static.igem.org/mediawiki/2013/4/4c/Goe-notThis.png" onclick="picSlide_i = ' + x + ';stopslide(); startslide()" />';}
Line 81: Line 90:
function go2left(){
function go2left(){
stoptimer();
stoptimer();
-
if (picSlide_i == 0) picSlide_i = 3;
+
if (picSlide_i == 0) picSlide_i = 5;
picSlide_i = picSlide_i - 2;
picSlide_i = picSlide_i - 2;
if (picSlide_i < 0) picSlide_i =2;
if (picSlide_i < 0) picSlide_i =2;
Line 119: Line 128:
}
}
-
function illus(left,top,name,text){
+
 
 +
function illus(object,name,text){
     var obj = document.getElementById("illus");
     var obj = document.getElementById("illus");
-
     obj.innerHTML = '<h2>' + name + '</h2>';
+
     obj.innerHTML = '<h2 style="color:white" >' + name + '</h2>';
-
     obj.innerHTML += '<p>'+ text + '</p>';
+
     var coords = object.coords;
-
     obj.style.lfet = left + 'px';
+
    var left = coords.substring(0,coords.indexOf(','));
-
     obj.style.top = top + 'px';
+
    coords = coords.substring(coords.indexOf(',')+1);
-
    
+
    var top = coords.substring(0,coords.indexOf(','));
 +
    coords = coords.substring(coords.indexOf(',')+1);
 +
    var width = coords.substring(0,coords.indexOf(',')) - left;
 +
    coords = coords.substring(coords.indexOf(',')+1);
 +
     obj.style.left = left + 'px';
 +
     obj.style.marginTop = coords - 40  + 'px';
 +
    obj.style.width = width -20 + 'px';
 +
    obj.onmouseout = function(){obj.style.display = 'none'}
 +
    obj.onmouseover = function(){obj.style.display = 'block';}
 +
    obj.onmousedown = function(){window.location.assign(object.href);}
 +
    obj.style.height = 40 + 'px';
 +
    obj.style.display = 'block';
 +
   //alert();
}
}
-
$(document).ready(function(){
+
 
-
    //universal
+
 
-
    ob1 = document.getElementById('col-left');
+
 
-
    rTop = 307;
+
function hideillus(){
-
  // window.setInterval('',20);
+
    var obj = document.getElementById("illus");
-
})
+
    obj.style.display = "none";
 +
}
 +
 
 +
 
 +
 
</script>
</script>
</html>
</html>

Latest revision as of 11:56, 2 October 2013