简体   繁体   English

网页中图像的灯箱模式

[英]light box modal for images in a web page

The following code is to retrieve 3 images and display in a table! 以下代码可检索3张图像并显示在表格中! i have imported the necessary jquery library and css script to implement the light box modal! 我已经导入了必要的jquery库和CSS脚本来实现灯箱模式!

            <?php
                require("includes/db.php");

                $sql="SELECT * FROM `order` ";
                $result=mysqli_query($db,$sql);
    echo"<head>";
    echo"<link rel='stylesheet' href='lightbox.css'>";
    echo"<script type='text/javascript' src='lightbox.min.js'>";
    echo"</script>";
    echo"</head>";

    echo "<body bgcolor=#E6E6FA>";
    echo "<table border=1 cellspacing=0 cellpadding=4 > " ;
while($row=mysqli_fetch_array($result))
{
  echo '<a href='.( $row['Image1'] ).'  data-lightbox="gallery"  >';
   echo "<img src='" .$row['Image1']. "' height='200' width='200'/>";
    echo "</a>";


    echo "<br>";
     echo"</td>";
    echo"<td align=center >";


    if($row['Image2']=="No copy"){
        echo "No copy";
    }
    else{
     echo '<a href='.( $row['Image2'] ).' data-lightbox="gallery" >';
   echo "<img src='" . $row['Image2'] . "' height='200' width='200'/>";
    }
    echo "</a>";


    echo "<br>";
     echo"</td>";
      echo"<td align=center >";

  if($row['Image3']=="No copy"){
        echo "No copy";
    }
    else{
     echo '<a href='.( $row['Image3'] ).'  data-lightbox="gallery"  >';
   echo "<img src='" . $row['Image3'] . "' height='200' width='200'/>";
    }
   echo "</a>";


    echo "<br>";


     echo"</tr>";

}
echo "</table>";

   ?> 

The above code does not work please help me! 上面的代码不起作用,请帮帮我! how do i need to corrrect the code? 我该如何纠正代码? I get the following errors in the developer tools! 在开发人员工具中出现以下错误!

lightbox.min.js:12 Uncaught TypeError: a is not a function
http://localhost/project1/test/images/close.png Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost/project1/test/images/prev.png Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost/project1/test/images/next.png Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost/project1/test/images/loading.gif Failed to load resource: the server responded with a status of 404 (Not Found)

问题出在第12行的lightbox.min.js文件中,而不是此PHP代码中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM