commit e457724dfdfa12b828343ca9adcde862e88f3270 parent ab2130fa2482bbb72b0a539cd6959c5427b36157 Author: MTRNord <mtrnord1@gmail.com> Date: Sat, 20 Dec 2014 18:02:34 +0100 new test :D Diffstat:
| M | themes/jumbotron/test.php | | | 35 | +++++++++++++++++------------------ |
1 file changed, 17 insertions(+), 18 deletions(-)
diff --git a/themes/jumbotron/test.php b/themes/jumbotron/test.php @@ -21,26 +21,25 @@ header("Cache-Control: no-cache, must-revalidate, no-store"); <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> <script type="text/javascript"> - $('div.buttons').on('click', 'input', function() { - var divs = $('div.showThese').children(); - - divs.eq($(this).index()).show().siblings().hide(); - }); + function showhide(id){ + if (document.getElementById) { + var divid = document.getElementById(id); + var divs = document.getElementsByClassName("hide"); + for(var i=0;i<divs.length;i++) { + divs[i].style.display = "none"; + } + divid.style.display = "block"; + } + return false; + } </script> </head> <body> -<div class="showThese"> - <div id="a" style="display:none">1</div> - <div id="b" style="display:none">2</div> - <div id="c" style="display:none">3</div> - <div id="d" style="display:none" >4</div> -</div> - -<div class="buttons"> - <input type="button" value="1" id="w"> - <input type="button" value="2" id="x"> - <input type="button" value="3" id="y"> - <input type="button" value="4" id="z"> -</div> +<div onclick="showhide('bill');" class="bio_image"><div class="name">Bill Murray</div></div> +<div onclick="showhide('bill2');" class="bio_image"><div class="name">Bill Murray</div></div> +<div onclick="showhide('bill3');" class="bio_image"><div class="name">Bill Murray</div></div> +<div class="hide" id="bill">BILL</div> +<div class="hide" id="bill2">BILL2</div> +<div class="hide" id="bill3">BILL3</div> </body> </html> \ No newline at end of file