<html>
<head>
<style type="text/css">
div{
display: none;
position: absolute;
height: 100%;
width: 100%;
padding-top: 1%;
z-index: 1024;
}
</style>
<link href="Fartune.css" rel="stylesheet" type="text/css">
<DIV onmousedown=m(this.id) id=div1 style="TOP:-10px">
<TABLE style="BACKGROUND: #000000; FILTER:progid:DXImageTransform.Microsoft.DropShadow
(color=#666666,offX=4,offY=4,positives=true); POSITION: static" cellSpacing=0
cellPadding=0 width="50%" align=center border=0>
<TBODY>
<TR style="CURSOR: move">
<TD width="100%" bgColor=#ffffff><img src="../images/zhanlanPic/013.png" border="0"></TD>
<TD align=right valign="top"><INPUT onclick="document.getElementById ('div1').style.display='none';" type=button value=x></TD></TR>
</TBODY></TABLE>
</DIV>
<DIV onmousedown=m(this.id) id=div2 style="TOP:-10px">
<TABLE
style="BACKGROUND: #000000; FILTER: progid:DXImageTransform.Microsoft.DropShadow
(color=#666666,offX=4,offY=4,positives=true); POSITION: static" cellSpacing=0
cellPadding=0 width="50%" align=center border=0>
<TBODY>
<TR style="CURSOR: move">
<TD width="100%" bgColor=#ffffff><img src="../images/zhanlanPic/0112.png" border="0"></TD>
<TD align=right valign="top"><INPUT onclick="document.getElementById ('div2').style.display='none';" type=button value=x></TD></TR>
</TBODY></TABLE>
</DIV>
//后面还有多个隐藏的层 省略
<LINK href="xlcd.css" rel=stylesheet>
<script type=text/javascript><!--//--><![CDATA[//><!--
function menuFix() {
var sfEls = document.getElementById("nav").getElementsByTagName("li");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls[i].onMouseDown=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls[i].onMouseUp=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"),
"");
}
}
}
window.onload=menuFix;
//more javascript
//--><!]]></script>
</head>
<body style="background-color:#333333; margin:0">
<table width="980" border="0" cellspacing="0" cellpadding="0">
// ........此处省略一段无关紧要的代码!
<tr>
<td width="150" height="100"><a href=# type="button" onClick="document.getElementById('div1').style.display='block';"><img src="../images/zhanlanPic/x6.png" width="150" height="100" style="border:0px"></a></td>
<td width="80"> </td>
<td width="150"><a href=# type="button" onClick="document.getElementById
('div2').style.display='block';"><img src="../images/zhanlanPic/x12.png" width="150" height="100" style="border:0px"></a></td>
<td width="80"><p> </p></td>
<td width="150"><a href=# type="button" onClick="document.getElementById
('div3').style.display='block';"><img src="../images/zhanlanPic/x3.png" width="150" height="100" style="border:0px"></a></td>
</tr></table></body></html>
我是在网页上有很多小图片 然后点击小图片跳出隐藏的层显示大图片,但问题是图片太多,导致上面要放很多个隐藏层, 想请高手帮忙用javascrip整合下,把上面的隐藏层弄成一个,当点小图片,则跳出层,而层里面显示的图片会自动显示相应的大图片。或者直接不用层就直接出大图片,然后点一下大图片就关闭图片的那种整合也行(我还没学这个,为了关闭跳出的图片就弄了层,旁边放了个按钮。所以麻烦了点)