如何为其他类别添加滑块

问题描述 投票:0回答:0

我正在主页上创建一个电子商务网站 将显示类别 我希望页面加载后只显示前四个类别。我想知道我们如何隐藏仅当用户单击按钮或滑块时才应显示的其他类别,我附上了我的类别的图像。 This image represents what my website categories currently look like

但是我想要这样的东西 在 PHP 和我的 SQL 中。

<div class="row" style="margin-bottom: 150px;">

<?php
while ($row_images=mysqli_fetch_assoc($records_images)) 
{
?>
<div class="col-md-3">
  <div class="cat_card scale_animation">
    <?php
    $path="Colour_farmer_Backend/Images_backend/Category_images/".$row_images['image_name'];
    echo "<img src='".$path."' class='img-fluid'>";
      $str ="select * from cf_categories where id='".$row_images['cat_id']."'";
      $cat_record=mysqli_query($con,$str);
      $cat_row=mysqli_fetch_assoc($cat_record);
      echo"<h4>".$cat_row['cat_name']."</h2>";
    ?>
  </div>
  <br>
</div>
<?php } ?>

</div>

此代码从我的数据库中获取和显示类别。

php mysql e-commerce categories
© www.soinside.com 2019 - 2024. All rights reserved.