我试图创建一个弹出窗口来显示已上传到我的数据库中的图像。
我试过了
echo '<td><a class=help href="'.$dbRow['image'].'"></td></tr>';
该类代表弹出类
<SCRIPT type="text/javascript">
$('.help').popupWindow({ height:400, width:500, top:100, left:100 });
</SCRIPT>
有关如何将图像作为弹出窗口从数据库中显示的任何建议吗?图像字段在我的网页上从数据库中检索,但需要单击作为弹出窗口显示
答案 0 :(得分:0)
请使用jQuery。
使用循环将所有图像回显到特定div。
<div class="help">
<?php
foreach($key as $value) {
echo '<a class="help" href="'.$value.'"><br/>';
}
?>
</div>
然后显示对话框
<script>
$('.help').dialog({
//your dialog options here
height:'500',
width:'500',
});
</script>
有关对话框的详细信息,请参阅jQuery dialog