87,994
社区成员
发帖
与我相关
我的任务
分享<?php
$conn=mysql_connect('localhost','root','');
mysql_select_db('php',$conn);
mysql_query('set names utf8');
$sql2="select * from class ";
$rest2=mysql_query($sql2);
while($Row=mysql_fetch_array($rest2))
{
echo "<a href='#' onclick='fun($Row[id])'>".$Row['class']."</a>"."<br>";
}
?>
<style>
.d{width:80px;
height:100px;
color:'blue';
background-color:'pink';
position:absolute;
border:1px solid;
cursor:pointer;
}
</style>
<script>
var zs = 0;
function fun(v){
var div = document.getElementById('d'+v);
if(div == null){
div = document.createElement('div');
div.className='d';
div.style.top=100+v*20
div.style.left=200+v*10;
div.id='d'+v;
div.innerHTML='<DIV id="divIDD"> <iframe src=c.asp?id=v width=436 height=314 scrolling=no name=IDD border=0 frameborder=0 marginwidth=1 marginheight=1> </iframe> </div>';
div.style.display='block';
div.zIndex=zs;
zs++;
div.onclick=function(){
div.style.zIndex=zs;
zs++;
}
document.body.appendChild(div);
}else{
div.style.zIndex=zs;
zs++;
}
}
</script>