我正在主页上创建一个电子商务网站 将显示类别 我希望页面加载后只显示前四个类别。我想知道我们如何隐藏仅当用户单击按钮或滑块时才应显示的其他类别,我附上了我的类别的图像。
<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>
此代码从我的数据库中获取和显示类别。