Template:Team:BGU Israel/javascript.js

From 2014.igem.org

(Difference between revisions)
 
(20 intermediate revisions not shown)
Line 2: Line 2:
         function goToByScroll(id) { $('html,body').animate({ scrollTop: $("#" + id).offset().top }, 'slow'); }
         function goToByScroll(id) { $('html,body').animate({ scrollTop: $("#" + id).offset().top }, 'slow'); }
function change_pic() {
function change_pic() {
-
img_count=(img_count+1)%7;
+
-
  var figure1 = document.getElementById("figure1");
+
switch(img_count) {
switch(img_count) {
     case 0:
     case 0:
        
        
-
       figure1.src = "https://static.igem.org/mediawiki/2014/f/f2/BGU14PGC-1-1.png";  
+
       $("#figure1").hide();
 +
$("#figure2").show();  
         break;
         break;
     case 1:
     case 1:
-
       figure1.src = "https://static.igem.org/mediawiki/2014/8/8d/BGU14PGC-1-2.png";
+
       $("#figure2").hide();
 +
$("#figure3").show();  
         break;
         break;
case 2:
case 2:
-
         figure1.src = "https://static.igem.org/mediawiki/2014/0/02/BGU14PGC-1-3.png";
+
         $("#figure3").hide();
 +
$("#figure4").show();  
         break;
         break;
case 3:
case 3:
-
      figure1.src = "https://static.igem.org/mediawiki/2014/f/ff/BGU14PGC-1-4.png";
+
        $("#figure4").hide();
 +
$("#figure5").show();  
         break;
         break;
case 4:
case 4:
-
         figure1.src = "https://static.igem.org/mediawiki/2014/7/79/BGU14PGC-1-5.png";
+
         $("#figure5").hide();
-
        break;
+
$("#figure1").show();  
-
case 5:
+
-
        figure1.src = "https://static.igem.org/mediawiki/2014/b/b8/BGU14PGC-1-6a.png"; 
+
-
        break;
+
-
case 6:
+
-
        figure1.src = "https://static.igem.org/mediawiki/2014/c/cc/BGU14PGC-1-6b.png";
+
         break;
         break;
 +
 +
 +
}
}
-
}
+
img_count=(img_count+1)%5;
-
function change_pic_artificial() {
+
} function change_pic_artificial() {
-
img_count=(img_count+1)%5;
+
-
  var figure1 = document.getElementById("figure1");
+
switch(img_count) {
switch(img_count) {
     case 0:
     case 0:
        
        
-
       figure1.src = "https://static.igem.org/mediawiki/2014/0/01/BGU14UCP-1-_1.png";  
+
       $("#figure1").hide();
 +
$("#figure2").show();  
         break;
         break;
     case 1:
     case 1:
-
       figure1.src = "https://static.igem.org/mediawiki/2014/c/c6/BGU14UCP-1-_2.png";
+
       $("#figure2").hide();
 +
$("#figure3").show();  
         break;
         break;
case 2:
case 2:
-
         figure1.src = "https://static.igem.org/mediawiki/2014/4/44/BGU14UCP-1-_3.png";
+
         $("#figure3").hide();
 +
$("#figure4").show();  
         break;
         break;
case 3:
case 3:
-
      figure1.src = "https://static.igem.org/mediawiki/2014/7/7f/BGU14UCP-1-_4_b.png";
+
        $("#figure4").hide();
-
        break;
+
$("#figure1").show();  
-
case 4:
+
-
        figure1.src = "https://static.igem.org/mediawiki/2014/5/5b/BGU14UCP-1-_4_c.png";
+
         break;
         break;
 +
 +
 
 
}
}
 +
img_count=(img_count+1)%4;
}
}
 +
function change_pic_hormone() {
function change_pic_hormone() {
-
img_count=(img_count+1)%4;
+
-
  var figure1 = document.getElementById("figure1");
+
switch(img_count) {
switch(img_count) {
     case 0:
     case 0:
        
        
-
       figure1.src = "https://static.igem.org/mediawiki/2014/1/12/BGU14adipo_figure_1.png";  
+
       $("#figure1").hide();
 +
$("#figure2").show();  
         break;
         break;
     case 1:
     case 1:
-
       figure1.src = "https://static.igem.org/mediawiki/2014/7/75/BGU14adipo_figure_2_a.png";
+
       $("#figure2").hide();
 +
$("#figure3").show();  
         break;
         break;
case 2:
case 2:
-
         figure1.src = "https://static.igem.org/mediawiki/2014/c/cb/BGU14adipo_figure_2_b.png";
+
         $("#figure3").hide();
 +
$("#figure1").show();
 +
        break;
 +
 +
 +
 +
 
 +
}
 +
img_count=(img_count+1)%3;
 +
}
 +
 
 +
function change_pic_intelligent() {
 +
 +
switch(img_count) {
 +
    case 0:
 +
     
 +
 
 +
      $("#figure1").hide();
 +
$("#figure2").show();
 +
        break;
 +
    case 1:
 +
      $("#figure2").hide();
 +
$("#figure3").show();
 +
        break;
 +
case 2:
 +
        $("#figure3").hide();
 +
$("#figure4").show();  
         break;
         break;
case 3:
case 3:
-
      figure1.src = "https://static.igem.org/mediawiki/2014/1/1b/BGU14adipo_figure_2_c.png";
+
        $("#figure4").hide();
 +
$("#figure5").show();  
         break;
         break;
 +
case 4:
 +
        $("#figure5").hide();
 +
$("#figure6").show();
 +
        break;
 +
case 5:
 +
        $("#figure6").hide();
 +
$("#figure7").show();
 +
        break;
 +
 +
case 6:
 +
        $("#figure7").hide();
 +
$("#figure8").show();
 +
        break;
 +
 +
case 7:
 +
        $("#figure8").hide();
 +
$("#figure9").show();
 +
        break;
 +
 +
case 8:
 +
        $("#figure9").hide();
 +
$("#figure1").show();
 +
        break;
 +
 +
 +
 
 
}
}
 +
img_count=(img_count+1)%9;
}
}
 +
 +
function test(url){
 +
document.getElementById("pdfObj").setAttribute('data',url);
 +
}
 +
var current="#april";
 +
function show(idDiv){
 +
$(current).hide();
 +
$(idDiv).show();
 +
current=idDiv;
 +
goToByScroll('jump');
 +
}
 +
function menu()
 +
{
 +
 +
 +
if($('.left-menu').is(':visible')) {
 +
      $('.left-menu').hide();
 +
      $('.right-menu').hide();
 +
      document.getElementById('wiki_menu_button').style.opacity= '0.4';
 +
    }else{
 +
      $('.left-menu').show();
 +
      $('.right-menu').show();
 +
      document.getElementById('wiki_menu_button').style.opacity= '1.0';
 +
    }
 +
}
 +
 +
var sd1=null;var sd2=null;var sd3=null;var sd4=null;sd5=null;sd6=null;sd7=null;
 +
        $(document).ready(function () {
 +
          sd1 = document.getElementById('strat1_text');
 +
sd2 = document.getElementById('strat2_text');
 +
sd3 = document.getElementById('strat3_text');
 +
sd4 = document.getElementById('strat4_text');
 +
  sd5 = document.getElementById('strat5_text');
 +
  sd6 = document.getElementById('strat6_text');
 +
    sd7 = document.getElementById('strat7_text');
 +
        });
 +
     
 +
 +
 +
 +
 +
$(document).ready(function () {
 +
$("#strat1").hover( function() {sd1.style.display = "block";},
 +
        function() {sd1.style.display = "none"});
 +
$("#strat2").hover( function() {sd2.style.display = "block";},
 +
        function() {sd2.style.display = "none";});
 +
$("#strat3").hover( function() {sd3.style.display = "block";},
 +
        function() {sd3.style.display = "none";});
 +
$("#strat4").hover( function() {sd4.style.display = "block";},
 +
        function() {sd4.style.display = "none";});
 +
$("#strat5").hover( function() {sd5.style.display = "block";},
 +
        function() {sd5.style.display = "none";});
 +
$("#strat6").hover( function() {sd6.style.display = "block";},
 +
        function() {sd6.style.display = "none";});
 +
$("#strat7").hover( function() {sd7.style.display = "block";},
 +
        function() {sd7.style.display = "none";});
 +
}
 +
);
 +
 +
var sd11=null;var sd22=null;var sd33=null;var sd44=null;var sd55=null;
 +
        $(document).ready(function () {
 +
          sd11 = document.getElementById('strat11_text');
 +
sd22 = document.getElementById('strat22_text');
 +
sd33 = document.getElementById('strat33_text');
 +
sd44 = document.getElementById('strat44_text');
 +
sd55 = document.getElementById('strat55_text');
 +
 +
        });
 +
 +
 +
 +
 +
$(document).ready(function () {
 +
$("#strat11").hover( function() {sd11.style.display = "block";},
 +
        function() {sd11.style.display = "none"});
 +
$("#strat22").hover( function() {sd22.style.display = "block";},
 +
        function() {sd22.style.display = "none";});
 +
$("#strat33").hover( function() {sd33.style.display = "block";},
 +
        function() {sd33.style.display = "none";});
 +
$("#strat44").hover( function() {sd44.style.display = "block";},
 +
        function() {sd44.style.display = "none";});
 +
$("#strat55").hover( function() {sd55.style.display = "block";},
 +
        function() {sd55.style.display = "none";  });
 +
}
 +
);
 +
 +
function testing()
 +
{
 +
$('#doc').animate({
 +
        top: "+=100px",
 +
left:"-=30px",
 +
opacity:"0"
 +
      }, 1000 );
 +
  window.setTimeout(partB,1000);
 +
 +
 +
}
 +
function partB()
 +
{
 +
$('#home_body').css('width','80%');
 +
$('#home_body').css('max-width','1079px');
 +
$('#home_body').css('overflow','visible');
 +
$('#opening').css('display','none');
 +
goToByScroll('gal');
 +
$('#main_nav').css('display','block');
 +
$('#top_doctor').css('display','block');
 +
$('html').css('background-color','#fff');
 +
$('#home_body').css('background-color','#fff');
 +
                $('#globalWrapper').css('width','1100px');
 +
$('body').css('width','1100px');
 +
$('#content').css('width','1100px');
 +
$('#bodyContent').css('width','1100px');
 +
$('body').css('max-width','1079');
 +
$('body').css('top','0px');
 +
$('#home_screen').css('display','block');
 +
                $('#foot').css('display','block');
 +
        $('#bodyContent').css('height','100%');
 +
                $('html').css('overflow','visible');
 +
}

Latest revision as of 22:52, 17 October 2014

var img_count=0;

       function goToByScroll(id) { $('html,body').animate({ scrollTop: $("#" + id).offset().top }, 'slow'); }

function change_pic() {


switch(img_count) {

   case 0:
     
      $("#figure1").hide();

$("#figure2").show();

       break;
   case 1:
      $("#figure2").hide();

$("#figure3").show();

       break;

case 2:

       $("#figure3").hide();

$("#figure4").show();

       break;

case 3:

       $("#figure4").hide();

$("#figure5").show();

       break;

case 4:

       $("#figure5").hide();

$("#figure1").show();

       break;



} img_count=(img_count+1)%5; } function change_pic_artificial() {


switch(img_count) {

   case 0:
     
      $("#figure1").hide();

$("#figure2").show();

       break;
   case 1:
      $("#figure2").hide();

$("#figure3").show();

       break;

case 2:

       $("#figure3").hide();

$("#figure4").show();

       break;

case 3:

       $("#figure4").hide();

$("#figure1").show();

       break;



} img_count=(img_count+1)%4; }

function change_pic_hormone() {


switch(img_count) {

   case 0:
     
      $("#figure1").hide();

$("#figure2").show();

       break;
   case 1:
      $("#figure2").hide();

$("#figure3").show();

       break;

case 2:

       $("#figure3").hide();

$("#figure1").show();

       break;



} img_count=(img_count+1)%3; }

function change_pic_intelligent() {

switch(img_count) {

   case 0:
     
      $("#figure1").hide();

$("#figure2").show();

       break;
   case 1:
      $("#figure2").hide();

$("#figure3").show();

       break;

case 2:

       $("#figure3").hide();

$("#figure4").show();

       break;

case 3:

       $("#figure4").hide();

$("#figure5").show();

       break;

case 4:

       $("#figure5").hide();

$("#figure6").show();

       break;

case 5:

       $("#figure6").hide();

$("#figure7").show();

       break;

case 6:

       $("#figure7").hide();

$("#figure8").show();

       break;

case 7:

       $("#figure8").hide();

$("#figure9").show();

       break;

case 8:

       $("#figure9").hide();

$("#figure1").show();

       break;



} img_count=(img_count+1)%9; }

function test(url){ document.getElementById("pdfObj").setAttribute('data',url); } var current="#april"; function show(idDiv){ $(current).hide(); $(idDiv).show(); current=idDiv; goToByScroll('jump'); } function menu() {


if($('.left-menu').is(':visible')) {
      $('.left-menu').hide();
      $('.right-menu').hide();
      document.getElementById('wiki_menu_button').style.opacity= '0.4';
    }else{
      $('.left-menu').show();
      $('.right-menu').show();
      document.getElementById('wiki_menu_button').style.opacity= '1.0';
    }

}

var sd1=null;var sd2=null;var sd3=null;var sd4=null;sd5=null;sd6=null;sd7=null;

       $(document).ready(function () {
         			 sd1 = document.getElementById('strat1_text');

sd2 = document.getElementById('strat2_text'); sd3 = document.getElementById('strat3_text'); sd4 = document.getElementById('strat4_text'); sd5 = document.getElementById('strat5_text'); sd6 = document.getElementById('strat6_text'); sd7 = document.getElementById('strat7_text');

       });
      



$(document).ready(function () { $("#strat1").hover( function() {sd1.style.display = "block";},

       function() {sd1.style.display = "none"});

$("#strat2").hover( function() {sd2.style.display = "block";},

       function() {sd2.style.display = "none";});

$("#strat3").hover( function() {sd3.style.display = "block";},

       function() {sd3.style.display = "none";});

$("#strat4").hover( function() {sd4.style.display = "block";},

       function() {sd4.style.display = "none";});

$("#strat5").hover( function() {sd5.style.display = "block";},

       function() {sd5.style.display = "none";});

$("#strat6").hover( function() {sd6.style.display = "block";},

       function() {sd6.style.display = "none";});

$("#strat7").hover( function() {sd7.style.display = "block";},

       function() {sd7.style.display = "none";});

} );

var sd11=null;var sd22=null;var sd33=null;var sd44=null;var sd55=null;

       $(document).ready(function () {
         			 sd11 = document.getElementById('strat11_text');

sd22 = document.getElementById('strat22_text'); sd33 = document.getElementById('strat33_text'); sd44 = document.getElementById('strat44_text'); sd55 = document.getElementById('strat55_text');

       });



$(document).ready(function () { $("#strat11").hover( function() {sd11.style.display = "block";},

       function() {sd11.style.display = "none"});

$("#strat22").hover( function() {sd22.style.display = "block";},

       function() {sd22.style.display = "none";});

$("#strat33").hover( function() {sd33.style.display = "block";},

       function() {sd33.style.display = "none";});

$("#strat44").hover( function() {sd44.style.display = "block";},

       function() {sd44.style.display = "none";});

$("#strat55").hover( function() {sd55.style.display = "block";},

       function() {sd55.style.display = "none";  });

} );

function testing() { $('#doc').animate({

       top: "+=100px",

left:"-=30px", opacity:"0"

     }, 1000 );

window.setTimeout(partB,1000);


} function partB() { $('#home_body').css('width','80%'); $('#home_body').css('max-width','1079px'); $('#home_body').css('overflow','visible'); $('#opening').css('display','none'); goToByScroll('gal'); $('#main_nav').css('display','block'); $('#top_doctor').css('display','block'); $('html').css('background-color','#fff'); $('#home_body').css('background-color','#fff');

               $('#globalWrapper').css('width','1100px');

$('body').css('width','1100px'); $('#content').css('width','1100px'); $('#bodyContent').css('width','1100px'); $('body').css('max-width','1079'); $('body').css('top','0px'); $('#home_screen').css('display','block');

               $('#foot').css('display','block');

$('#bodyContent').css('height','100%');

               $('html').css('overflow','visible');

}