Team:ETH Zurich/tpl/head/animbuttons

From 2014.igem.org

(Difference between revisions)
 
(10 intermediate revisions not shown)
Line 10: Line 10:
         $("img.animation").hide();
         $("img.animation").hide();
-
         $("img.animation#noneblue").show();
+
         $("img.animation#luxblue").show();
-
    $("svg.animbutton").on("click", function(){
+
    $("svg.animbutton").on("click", function(){
         var filtertag = $(this).attr('id');
         var filtertag = $(this).attr('id');
         $("img.animation").hide();
         $("img.animation").hide();
         $("img.animation").filter('#' + filtertag).show();
         $("img.animation").filter('#' + filtertag).show();
 +
        $('img.animation#'+filtertag).load();
                                               });
                                               });
     $("text.anim").on("click", function(){
     $("text.anim").on("click", function(){
       var ID = $(this).attr("name");
       var ID = $(this).attr("name");
-
      $(this).text(function(i, text){
+
        $("svg.animbutton").hide();
-
          return text === "Red Cell" ? "Blue Cell" : "Red Cell";
+
        $("svg.animbutton#none"+ID).show();
-
      })
+
        $("svg.animbutton#both"+ID).show();
-
         $("svg.animbutton").toggle();
+
        $("svg.animbutton#lux"+ID).show();
 +
        $("svg.animbutton#las"+ID).show();
 +
        $("img.animation").hide();
 +
         $("img.animation#none"+ID).show();
 +
        $("img.animation#none"+ID).load();
     });
     });
     $("polygon.anim").on("click", function(){
     $("polygon.anim").on("click", function(){
-
       var ID = $(this).next().attr("name");
+
       var ID = $(this).attr("name");
-
      $(this).next().text(function(i, text){
+
        $("svg.animbutton").hide();
-
          return text === "Red Cell" ? "Blue Cell" : "Red Cell";
+
        $("svg.animbutton#none"+ID).show();
-
      })
+
        $("svg.animbutton#both"+ID).show();
-
         $("svg.animbutton").toggle();
+
        $("svg.animbutton#lux"+ID).show();
 +
        $("svg.animbutton#las"+ID).show();
 +
        $("img.animation").hide();
 +
        $("img.animation#none"+ID).show();
 +
         $("img.animation#none"+ID).load();
     });
     });
});
});

Latest revision as of 16:09, 11 October 2014