Advertisement
PaulCastellano

.html

Sep 23rd, 2018
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.46 KB | None | 0 0
  1. <html>
  2. <head>  
  3.  
  4. </head>
  5.  
  6. <body>
  7.  
  8.   <div id="item-list">
  9. <ul>
  10. <?php
  11. if ($result->num_rows > 0) {
  12.     while($row = $result->fetch_assoc()) { ?>
  13.     <li>
  14.     <a class="expand">
  15.     <div class="right-arrow">+</div>
  16.     <div style="          height: 217px;
  17.           width: 400px;
  18.           float: left;
  19.           margin: 0 15px 0 0; background: url(http://balkan-elite.info/ucp/assets/vozila/<?php echo $row['ID'];?>.jpg) top left no-repeat;"></div>
  20.     <h2><?php echo $row['Name'];?></h2>
  21.     <span>Model ID: <?php echo $row['ID'];?></span>
  22.     </a>
  23.    
  24.     <div class="detail">
  25.       <div><span>Kategorija: <?php echo $row['Category'];?></span></div>
  26.       <div><span>Maksimalna brzina: <?php echo $row['Speed'];?></span></div>
  27.       <div><span>Ukupno vozila na serveru: <?php echo $row['count(Model)'];?></span></div>
  28.       <div><span>Prosjecna cijena: <?php echo number_format($row['AVG(Cijena)']);?>$</span></div>
  29.      
  30.       <!--<span class="button">Vise informacija</span> -->
  31.     </div>
  32.   </li>
  33.             <?php
  34.    }
  35. } else {
  36.    echo "Dogodila se pogreska";
  37. }
  38.  
  39. ?>
  40. </ul>
  41. </div>
  42.   <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
  43.  
  44.  
  45.  
  46. <script>
  47. $(function() {
  48.   $(".expand").on( "click", function() {
  49.     $(this).next().slideToggle(100);
  50.     $expand = $(this).find(">:first-child");
  51.    
  52.     if($expand.text() == "+") {
  53.       $expand.text("-");
  54.     } else {
  55.       $expand.text("+");
  56.     }
  57.   });
  58. });
  59. </script>
  60.  
  61.  
  62.  
  63. </body>
  64.  
  65. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement