我想做的是让 iframe 浮动在其余内容之上。zindex 似乎没有工作
<html>
<head>
<script language="JavaScript" type="text/javascript">
function makeFrame(src) {
ifrm = document.createElement("IFRAME");
ifrm.setAttribute("src","http://www.google.com");
ifrm.style.display = "block";
ifrm.style.width = 640+"px";
ifrm.style.height = 480+"px";
ifrm.style.position = "absolute";
ifrm.style.zIndex= "2";
document.body.appendChild(ifrm);
}
function closeFrame(){
ifrm.style.display = "none";
}
</script>
</head>
<body>
<img src="" onmouseover=makeFrame() onmouseout=closeFrame() height="100px" width="100px" />
</body>
</html>