javascript - Why does my jQuery slidedown not work in my table? -
i'm trying slider work won't. works when i'm not using table website need table can display members. what's wrong code? information has below name, not next it.
<!doctype html> <html> <head> <title>bestuur</title> <link rel="icon" href="images/favicon.png"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> <script> $(document).ready(function(){ $("#flip").click(function(){ $("#panel").slidetoggle("slow"); }); }); </script> <style type="text/css"> body { font-family: "helvetica neue",helvetica,arial,sans-serif; } table { border-collapse: collapse; } th, td { padding: 8px; text-align: left; border-bottom: 1px solid #ddd; } ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; border: 1px solid #e7e7e7; background-color: #f3f3f3; } li { float: left; } li { display: block; color: #666; text-align: center; padding: 14px 16px; text-decoration: none; } li a:hover:not(.active) { background-color: #ddd; } li a.active { color: white; background-color: #42a5f5; } #panel, #flip { padding: 5px; } #panel { display: none; } </style> </head> <ul class="horizontal gray"> <li><a class="active" href="index.php">bestuur</a></li> <li><a href="bestuurwijzigen.php">bestuur wijzigen</a></li> <li><a href="bestuurtoevoegen.php">bestuur toevoegen</a></li> </ul> <div> <table class="table" border="1" frame="void" rules="rows"> <tbody> <tr> <th>naam</th> <th>functie</th> </tr> <tr> <td><div id="flip">pieter schreurs</td> <td> <label for="pieter">secretaris</label> </div></td> <td><div id="panel">hidden information</div></td> </tr> <tr> <td>wessel oblink</td> <td> <label for="wessel">penningmeester</label> </td> </tr> <tr> <td>luca fraser</td> <td> <label for="luca">voorzitter</label> </td> </tr> </tbody> </table> </div> </html>
i tidied markup - div
s , td
s closing incorrectly , moved #panel
. you're after?
$(document).ready(function() { $("#flip").click(function() { $("#panel").slidetoggle("slow"); }); });
body { font-family: "helvetica neue", helvetica, arial, sans-serif; } table { border-collapse: collapse; } th, td { padding: 8px; text-align: left; border-bottom: 1px solid #ddd; } ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; border: 1px solid #e7e7e7; background-color: #f3f3f3; } li { float: left; } li { display: block; color: #666; text-align: center; padding: 14px 16px; text-decoration: none; } li a:hover:not(.active) { background-color: #ddd; } li a.active { color: white; background-color: #42a5f5; } #panel, #flip { padding: 5px; } #panel { display: none; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <ul class="horizontal gray"> <li><a class="active" href="index.php">bestuur</a></li> <li><a href="bestuurwijzigen.php">bestuur wijzigen</a></li> <li><a href="bestuurtoevoegen.php">bestuur toevoegen</a></li> </ul> <div> <table class="table" border="1" frame="void" rules="rows"> <tbody> <tr> <th>naam</th> <th>functie</th> </tr> <tr> <td width="200"> <div id="flip">pieter schreurs</div> <div id="panel">hidden information</div> </td> <td> <label for="pieter">secretaris</label> </td> </tr> <tr> <td>wessel oblink</td> <td> <label for="wessel">penningmeester</label> </td> </tr> <tr> <td>luca fraser</td> <td> <label for="luca">voorzitter</label> </td> </tr> </tbody> </table> </div>
Comments
Post a Comment