Team:ETH Zurich/labblog/buttons

From 2014.igem.org

(Difference between revisions)
Line 2: Line 2:
<script>
<script>
-
$("button").click(function() {
+
$("article").show();//if you want them shown to start with
-
    var show = $(this).attr('class');
+
     $("button").on("click", function(){
-
     $("article").each(function(){
+
         var filtertag = $(this).attr('class');
-
        $(this).show();
+
         $("article").hide().filter('.' + filtertag).show();
-
         var test = $(this).attr('class');
+
     })
-
         if (test.indexOf(show) < 0) $(this).hide();
+
[0].click();
-
     });
+
-
});
+
</script>
</script>

Revision as of 09:34, 26 August 2014