SHARE
TWEET

Untitled

a guest Jan 18th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) {
  2. $display1=$display1+1;
  3.     echo '
  4.     <tr class="tablerow">
  5.         <td>' . $row['id'] . '</td>
  6.         <td><p class="state">' . $row['name'] . '</p></td>
  7.         <td><p class="state">' . $row['surname'] . '</p></td>
  8.         <td>' . $row['country'] . '</td>
  9.         <td>' . $row['city'] . '</td>
  10.         <td>' . $row['category'] . '</td>
  11.     </tr>';
  12. if($row['id']==$_GET['showrow'])
  13. {
  14.     echo '
  15.     <tr class="subtable" style="display:none;">';
  16.         echo '<td colspan="3" class="detalji"></td>
  17.         <td align="left" colspan="3" class="detalji"></td>
  18.         </tr>';}} // End of WHILE loop.
  19. echo '</table>';
  20.    
  21. /* Table row click */
  22. $(".tablerow").click(function()
  23. {
  24.   $(".subtable").show();
  25. });
  26.  
  27. $(".subtable").click(function()
  28. {
  29.   $(".subtable").hide();
  30. });
  31.    
  32. $(".tablerow").click(function() {
  33.     // Hideing all the tr with class subtable rows initially
  34.     $('.subtable').hide();
  35.     // Find the next tr which has class subclass in current context
  36.     $(this).next('.subtable').show();
  37. });
  38.  
  39. $(".subtable").click(function() {
  40.     // Hide current row that has class subtable
  41.     $(this).hide();
  42. });​
  43.    
  44. $(".tablerow").click(function()
  45. {
  46.   $(this).next(".subtable").slideDown("slow");
  47. });
  48.  
  49. $(".subtable").click(function()
  50. {
  51.   $(".subtable").hide();
  52. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top