Team:ETH Zurich/tpl/head/animbuttons

From 2014.igem.org

(Difference between revisions)
 
(13 intermediate revisions not shown)
Line 4: Line 4:
$(document).ready(function(){
$(document).ready(function(){
-
         $("p.animation").hide();
+
         $("svg.animbutton#lasred").hide();
-
         $("p.animation#noneblue").show();
+
        $("svg.animbutton#luxred").hide();
-
    $("svg.animbutton").on("click", function(){
+
        $("svg.animbutton#nonered").hide();
 +
        $("svg.animbutton#bothred").hide();
 +
 
 +
        $("img.animation").hide();
 +
         $("img.animation#luxblue").show();
 +
    $("svg.animbutton").on("click", function(){
         var filtertag = $(this).attr('id');
         var filtertag = $(this).attr('id');
-
         $("p.animation").hide();
+
         $("img.animation").hide();
-
         $("p.animation").filter('#' + filtertag).show();
+
         $("img.animation").filter('#' + filtertag).show();
 +
        $('img.animation#'+filtertag).load();
                                               });
                                               });
 +
 +
    $("text.anim").on("click", function(){
 +
      var ID = $(this).attr("name");
 +
        $("svg.animbutton").hide();
 +
        $("svg.animbutton#none"+ID).show();
 +
        $("svg.animbutton#both"+ID).show();
 +
        $("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(){
 +
      var ID = $(this).attr("name");
 +
        $("svg.animbutton").hide();
 +
        $("svg.animbutton#none"+ID).show();
 +
        $("svg.animbutton#both"+ID).show();
 +
        $("svg.animbutton#lux"+ID).show();
 +
        $("svg.animbutton#las"+ID).show();
 +
        $("img.animation").hide();
 +
        $("img.animation#none"+ID).show();
 +
        $("img.animation#none"+ID).load();
 +
    });
});
});
</script>
</script>
</html>
</html>

Latest revision as of 16:09, 11 October 2014