当我构建这个循环时,我的图像和缩略图会显示,但是,我无法让我的 onClick 函数使用 onClick 的值重建主图像
if($Image_Count > 0){
$structure = "./images/$City_R/$Zip_Code_R/$StreetDirection $StreetName/$StreetNumber $StreetDirection $StreetName $StreetSuffix $City_R $Zip_Code_R-1";
$img = '<img src="'.$structure.'.jpeg" style="border-style:solid; border-width:10px; border-color:#fff; width=500px; id=Main_Image;"><br/>';
}else{
$img = "";
}
$Count_Image=1;
if($Image_Count > 1){
while($Count_Image <= $Image_Count){
if($Count_Image < 10){
$Count_Image = ''.$Count_Image;
}
$structure = "./images/$City_R/$Zip_Code_R/$StreetDirection $StreetName/$StreetNumber $StreetDirection $StreetName $StreetSuffix $City_R $Zip_Code_R-$Count_Image";
$img_Thumb .= "<img src=\"$structure.jpeg\" onclick=\"document.getElementById('Main_Image').src = '\$structure.jpeg' ;\" width=\"50px\" border=\"0\" style=\"border-style=:solid;border-width:2px;border-color:#fff;margin-right:0px;\">";
$Count_Image++;
}
}