下面的代码是检索3张图片并显示在一个表中!我已经导入了必要的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>";
?>
上面的代码不工作,请帮助我!我需要如何更正代码?我在开发人员工具中得到以下错误!
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)
问题在lightbox.min.js
文件的第12行,而不是在这个PHP代码。