问题内容: my code is <div align="center"> <div id="imgGallary" class="container"> <?php $get_products = $conn->query("SELECT * FROM products"); while ($show_products = $get_products->fetch_assoc()) { ?> <h1><?php echo $show_products['name']; ?></h1> <img src="img/<?php echo $show_products['img']; ?>" alt="" width="100%" height="300" > <?php } ?> </div> </div> <script> (function(){ var imgLen = document.getElementById('imgGallary'); var images = imgLen.getElementsByTagName('img'); var counter = 1; if(counter