Difference between revisions of "Team:Hong Kong-CUHK/Notebook"

Line 32: Line 32:
 
<body>
 
<body>
  
<button onclick="myFunction()">Try it</button>
+
<div id="hidden_div" style="display: none;">
<a  class="showSingle" target="1">Show/Hide</a>April 2016
+
        <button onclick="showHide('q4'); return false;">iPhone 5</button>
 +
April 2016
 
<p>
 
<p>
<div id="div1" class="targetDiv">
+
<div id="q4" style="display: none;">
 
<ul>Settlement of lab duties and position.</ul>
 
<ul>Settlement of lab duties and position.</ul>
  
Line 56: Line 57:
 
<head>
 
<head>
  
<script>
+
<script type="text/javascript">
$('#showall').click(function(){
+
        function showHide(obj) {
    $('div').show();
+
            var div = document.getElementById(obj);
});
+
            if (div.style.display == 'none') {
 +
                div.style.display = '';
 +
            }
 +
            else {
 +
                div.style.display = 'none';
 +
            }
 +
        }
 +
    </script>
  
$('#showdiv1').click(function(){
 
    $('div[id^=div]').hide();
 
    $('#div1').show();
 
});
 
$('#showdiv2').click(function(){
 
    $('div[id^=div]').hide();
 
    $('#div2').show();
 
});
 
 
$('#showdiv3').click(function(){
 
    $('div[id^=div]').hide();
 
    $('#div3').show();
 
});
 
 
$('#showdiv4').click(function(){
 
    $('div[id^=div]').hide();
 
    $('#div4').show();
 
 
});
 
</script>
 
  
  

Revision as of 13:37, 10 August 2017