Team:ETH Zurich/tpl/head/animbuttons

From 2014.igem.org

(Difference between revisions)
Line 4: Line 4:
$(document).ready(function(){
$(document).ready(function(){
 +
        $("svg.animbutton.lasred").hide();
 +
        $("svg.animbutton.luxred").hide();
 +
        $("svg.animbutton.nonered").hide();
 +
        $("svg.animbutton.bothred").hide();
 +
         $("img.animation").hide();
         $("img.animation").hide();
         $("img.animation#noneblue").show();
         $("img.animation#noneblue").show();
Line 11: Line 16:
         $("img.animation").filter('#' + filtertag).show();
         $("img.animation").filter('#' + filtertag).show();
                                               });
                                               });
 +
 +
    $("text.anim").on("click", function(){
 +
      var ID = $(this).attr("name");
 +
      $(this).text(function(i, text){
 +
          return text === "Red Cell" ? "Blue Cell" : "Red Cell";
 +
      })
 +
        $("svg.animbutton").toggle();
 +
    });
 +
 +
    $("polygon.anim").on("click", function(){
 +
      var ID = $(this).next().attr("name");
 +
      $(this).next().text(function(i, text){
 +
          return text === "Red Cell" ? "Blue Cell" : "Red Cell";
 +
      })
 +
        $("svg.animbutton").toggle();
 +
    });
});
});
</script>
</script>
</html>
</html>

Revision as of 12:44, 10 October 2014