Team:Freiburg/Project/toolkit

From 2013.igem.org

(Difference between revisions)
Line 11: Line 11:
<script type="text/javascript">
<script type="text/javascript">
-
        function showDiv (divId)
+
$(document).ready(function(){
-
        {
+
    $('.radioBtn').click(function(){
-
          var div = document.getElementById (divId);
+
        var div_id = $(this).attr('div_id');
-
          var divs = document.getElementsByTagName('div');
+
        $('.my-div').hide();  
-
          for (var i in divs)  
+
        $('.me_'+div_id).show();  
-
          {
+
    });  
-
            divs [i].className = "hidden";
+
});
-
          }
+
-
          div.className = "shown";
+
-
        }
+
     </script>
     </script>
Line 40: Line 37:
}
}
-
.hidden {
 
-
display:none;
 
-
}
 
-
.shown {
 
-
display:block;
 
-
}
 
Line 92: Line 83:
-
<input type="radio" onclick="showDiv ('1')" name="selectme">1</input>
+
<div class="my-div me_1">1</div>
-
        <input type="radio" onclick="showDiv ('2')" name="selectme">2</input>
+
<div class="my-div me_2">2</div>
-
        <input type="radio" onclick="showDiv ('3')" name="selectme">3</input>
+
<div class="my-div me_3">3</div>
-
        <input type="radio" onclick="showDiv ('4')" name="selectme">4</input>
+
<div class="my-div me_4">4</div>
-
 
+
<div class="my-div me_5">5</div>
-
 
+
-
 
+
-
 
+
-
 
+
-
      <div id="1" class="hidden">Hey, its me, 1</div>
+
-
        <div id="2" class="hidden">Hey, its me, 2</div>
+
-
        <div id="3" class="hidden">Hey, its me, 3</div>
+
-
        <div id="4" class="hidden">Hey, its me, 4</div>
+
 +
<input type="radio" div_id="1" class="radioBtn">
 +
<input type="radio" div_id="2" class="radioBtn">
 +
<input type="radio" div_id="3" class="radioBtn">
 +
<input type="radio" div_id="4" class="radioBtn">
 +
<input type="radio" div_id="5" class="radioBtn">

Revision as of 23:39, 17 September 2013