定位层

.f1 {
 position: relative; clip:rect( )
 }

把层放于表格中,其<td class="f1"><div></div></td>

层运用:

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,net.gov.service.*,java.util.*,net.gov.link.*,java.text.SimpleDateFormat,net.gov.publicinfo.DealStrings" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
</head>
<style type="text/css">
<!--

#Layer3 {
 position:absolute;
 width:200px;
 height:115px;
 z-index:1;
 left: 180px;
 top: 88px;
}
#Layer1 {
 position:absolute;
 width:200px;
 height:115px;
 z-index:1;
 left: 338px;
 top: 84px;
 visibility: hidden;
}
#Layer2 {
 position:absolute;
 width:66px;
 height:24px;
 z-index:4;
}
-->
</style>
<%int m=0;int newsid=0;ArrayList newsList;%>
<script language="javascript">
function ss(id,name)
{
document.getElementById("id1").style.visibility="inherit";
}
function dis_menu(id,name){
 //id.style.visibility="default";
 if("id1"==id){
   //alert(id.id+"1")
   document.getElementById("id2").style.visibility="hidden";
    document.getElementById("id3").style.visibility="hidden";
  document.getElementById("id1").style.visibility="inherit";
  document.getElementById("id7").style.visibility="inherit";
   document.getElementById("id1").style.top="254px";
   document.getElementById("id1").style.left="5px";
  document.getElementById("id6").style.visibility="inherit";
   document.getElementById("id8").style.visibility="inherit";
   var s =document.getElementById("id7");
 //alert(texe);
//alert(s.childNodes.length);
    while (s.childNodes.length > 0)
    {
     s.removeChild(s.childNodes[0]);
     
    } 
    var result1 = document.createElement("span");
     result1.style.textAlign = "left";   
     result1.style.fontFamily = "Arial, Verdana";
     result1.innerHTML ="<embed src='"+name+"' border='0' width='195' height='146' type='application/x-mplayer2'></embed>";
     //result.appendChild(result1);
     s.appendChild(result1);  
 //id.style.visibility="hidden";
    // document.getElementById(id2).style.display="";
 }
 
if("id2"==id){
   //alert(id.id+"1")
   document.getElementById("id2").style.visibility="inherit";
    document.getElementById("id3").style.visibility="hidden";
  document.getElementById("id1").style.visibility="hidden";
   document.getElementById("id2").style.top="254px";
   document.getElementById("id2").style.left="5px";
     document.getElementById("id7").style.visibility="inherit";
   document.getElementById("id8").style.visibility="inherit";

  document.getElementById("id6").style.visibility="inherit";
   var s =document.getElementById("id7");
 //alert(texe);
//alert(s.childNodes.length);
    while (s.childNodes.length > 0)
    {
     s.removeChild(s.childNodes[0]);
     
    } 
    var result1 = document.createElement("span");
     result1.style.textAlign = "left";   
     result1.style.fontFamily = "Arial, Verdana";
     result1.innerHTML ="<embed src='"+name+"' border='0' width='195' height='146' type='application/x-mplayer2'></embed>";
     //result.appendChild(result1);
     s.appendChild(result1);  
 //id.style.visibility="hidden";
    // document.getElementById(id2).style.display="";
 }
 if("id3"==id){
   //alert(id.id+"1")
   document.getElementById("id2").style.visibility="hidden";
    document.getElementById("id3").style.visibility="inherit";
  document.getElementById("id1").style.visibility="hidden";
   document.getElementById("id1").style.top="254px";
   document.getElementById("id1").style.left="5px";
    document.getElementById("id7").style.visibility="inherit";
   document.getElementById("id8").style.visibility="inherit";

 document.getElementById("id6").style.visibility="inherit";
   var s =document.getElementById("id7");
 //alert(texe);
//alert(s.childNodes.length);
    while (s.childNodes.length > 0)
    {
     s.removeChild(s.childNodes[0]);
     
    } 
    var result1 = document.createElement("span");
     result1.style.textAlign = "left";   
     result1.style.fontFamily = "Arial, Verdana";
     result1.innerHTML ="<embed src='"+name+"' border='0' width='195' height='146' type='application/x-mplayer2'></embed>";
     //result.appendChild(result1);
     s.appendChild(result1);  
 //id.style.visibility="hidden";
    // document.getElementById(id2).style.display="";
 }
 
 /*if("id2"==id){
     id.style.display="" ;
     document.getElementById(id3).style.display="";
 }
 if("id3"==id){
     id.style.display="" ;
     document.getElementById(id2).style.display="";
 }*/
 }
 function dis(){
  document.getElementById("id1").style.visibility="inherit";
   document.getElementById("id2").style.visibility="inherit";
   document.getElementById("id3").style.visibility="inherit";
      document.getElementById("id7").style.visibility="hidden";
   document.getElementById("id6").style.visibility="hidden";
   document.getElementById("id8").style.visibility="hidden";
    document.getElementById("id1").style.top="0px";
   document.getElementById("id1").style.left="5px";
    document.getElementById("id2").style.top="127px";
   document.getElementById("id2").style.left="5px";
    document.getElementById("id3").style.top="254px";
   document.getElementById("id3").style.left="5px";
 }
</script>
<link href="images/main.css" rel="stylesheet" type="text/css">
<jsp:useBean id="news" scope="page" class="net.gov.service.news"></jsp:useBean>
<jsp:useBean id="newsCtl" scope="page" class="net.gov.service.newsCtl"></jsp:useBean>
<jsp:useBean id="pkind" scope="page" class="net.gov.service.srcColumn"></jsp:useBean>
<jsp:useBean id="pkCtl" scope="page" class="net.gov.service.srckindCtl"></jsp:useBean>
<jsp:useBean id="vote" scope="page" class="net.gov.service.Vote"></jsp:useBean>
<jsp:useBean id="voteCtl" scope="page" class="net.gov.service.voteCtl"></jsp:useBean>
<jsp:useBean id="link" class="net.gov.link.Link" scope="page"/>
<jsp:useBean id="linkOpe" class="net.gov.link.linkCtl" scope="page"/>
<jsp:useBean id="linktype" class="net.gov.link.linkType" scope="page"/>
<jsp:useBean id="typeOpe" class="net.gov.link.lkTypeCtl" scope="page"/>
<body background="images/spzx-bg.gif">
 <table width="101%" height="392" border="0" cellpadding="0" cellspacing="0"  background="images/spzx-bg.gif">
  <tr>
    <td height="392" class="f1">
     <div id="id8" style="position:absolute; width:29px; height:26px; z-index:5; left: 270px; top: 260px; border:0; visibility: hidden;"><a href="#" οnclick="javascript:dis();"><font color="#FF0000">返回</font></a></div>
     <div id="id6" style="position:absolute;  width:300px; height:163px; visibility: hidden;left: 5px;" align="center"><table width="216" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0" background="images/vidio1.jpg">
  <tr>
    <td height="180" align="center" class="f1"><div id="id7" style="position:absolute;  width:193px; height:120px; visibility: hidden; left: 11px; top: 28px;"><span  style="background:url(images/vidio1.jpg)">
      <embed src="UploadPath/2007-12-07/2007-12-07 20112147.avi" border="0" width="194" height="115" type="application/x-mplayer2"></embed>
    </span></div></td>
  </tr>
</table></td>
  </tr>
</table></div>
     <table width="90%" border="0">
       <tr>
         <td><div id="id1"  style="position:absolute; width:329px; height:54px; z-index:1; left: 5px; top: 0px; border:0">
             <table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
               <tr>
                 <td colspan="2"><img src="images/web_59.jpg" width="323" height="29" alt="" /></td>
               </tr>
               <tr>
                 <td width="34%" align="center"><img src="images/web_63.jpg" width="102" height="73" alt="" /></td>
                 <td width="66%" height="90" valign="top"><% m=0;
   newsid=pkCtl.getKindname("与公仆对话");
     newsList=newsCtl.getNews(4,newsid);
    for(Iterator it=newsList.iterator();it.hasNext();){
       news=(news)it.next();
       int nid=news.getId();
      String title=news.getTitle();
    String filename=news.getFilename();
       if(title.length()>15){
        title=title.substring(0,15)+"...";
      }
      m++;
     %>
                     <table width="96%" height=14 border=0 align="center" cellpadding=0 cellspacing=0>
                       <tbody>
                         <tr>
                           <td class=hong align=center width="13"><img src="images/dotdb.gif" width="9" height="11" /></td>
                           <td height="24" align=left><a class=blk
                              href="#" οnclick="dis_menu('id1','UploadPath/<%=filename%>');"
                              ><%=title%></a></td>
                         </tr>
                       </tbody>
                     </table>
                   <%}
   if(m==0){
   %>
                     <table width="96%" height=14 border=0 align="center" cellpadding=0 cellspacing=0>
                       <tbody>
                         <tr>
                           <td class=hong align=center width="13">&nbsp;</td>
                           <td height="24" align=left class="copy18">暂无视频</td>
                         </tr>
                       </tbody>
                     </table>
                  <%}%>                 </td>
               </tr>
             </table>
         </div>
             <div id="id2" οnclick="javascript:dis_menu(id2);" style="position:absolute; width:329px; height:48px; z-index:2; left: 5px; top: 127px; border:0 ">
               <table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
                 <tr>
                   <td colspan="2"><img src="images/web_68.jpg" width="323" height="27" alt="" /></td>
                 </tr>
                 <tr>
                   <td width="34%" align="center"><img src="images/web_72.jpg" width="102" height="73" alt="" /></td>
                   <td width="66%" height="90" valign="top"><%m=0;
   newsid=pkCtl.getKindname("与成功对话");
     newsList=newsCtl.getNews(4,newsid);
    for(Iterator it=newsList.iterator();it.hasNext();){
       news=(news)it.next();
       int nid=news.getId();
      String title=news.getTitle();
    String filename=news.getFilename();
       if(title.length()>15){
        title=title.substring(0,15)+"...";
      }
      m++;
     %>
                       <table width="96%" height=14 border=0 align="center" cellpadding=0 cellspacing=0>
                         <tbody>
                           <tr>
                             <td class=hong align=center width="13"><img src="images/dotdb.gif" width="9" height="11" /></td>
                             <td height="24" align=left><a class=blk
                              href="#" οnclick="dis_menu('id2','UploadPath/<%=filename%>');"
                              ><%=title%></a></td>
                           </tr>
                         </tbody>
                       </table>
                     <%}
   if(m==0){
   %>
                       <table width="96%" height=14 border=0 align="center" cellpadding=0 cellspacing=0>
                         <tbody>
                           <tr>
                             <td class=hong align=center width="13">&nbsp;</td>
                             <td height="24" align=left class="copy18">暂无视频</td>
                           </tr>
                         </tbody>
                       </table>
                   <%}%>                   </td>
                 </tr>
               </table>
             </div>
           <div id="id3" οnclick="javascript:dis_menu(id3);" style="position:absolute; width:329px; height:76px; z-index:3; left: 5px; top: 254px; border:0">
               <table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
                 <tr>
                   <td colspan="2"><img src="images/web_75.jpg" width="323" height="27" alt="" /></td>
                 </tr>
                 <tr>
                   <td width="34%" align="center"><img src="images/web_79.jpg" width="102" height="73" alt="" /></td>
                   <td width="66%" height="90" valign="top"><%m=0;
   newsid=pkCtl.getKindname("与品牌对话");
     newsList=newsCtl.getNews(4,newsid);
    for(Iterator it=newsList.iterator();it.hasNext();){
       news=(news)it.next();
       int nid=news.getId();
      String title=news.getTitle();
    String filename=news.getFilename();
       if(title.length()>15){
        title=title.substring(0,15)+"...";
      }
      m++;
     %>
                       <table width="96%" height=14 border=0 align="center" cellpadding=0 cellspacing=0>
                         <tbody>
                           <tr>
                             <td class=hong align=center width="13"><img src="images/dotdb.gif" width="9" height="11" /></td>
                             <td height="24" align=left><a class=blk
                              href="#" οnclick="dis_menu('id3','UploadPath/<%=filename%>');"
                              ><%=title%></a></td>
                           </tr>
                         </tbody>
                       </table>
                     <%}
   if(m==0){
   %>
                       <table width="96%" height=14 border=0 align="center" cellpadding=0 cellspacing=0>
                         <tbody>
                           <tr>
                             <td class=hong align=center width="13">&nbsp;</td>
                             <td height="24" align=left class="copy18">暂无视频</td>
                           </tr>
                         </tbody>
                       </table>
                     <%}%></td>
                 </tr>
               </table>
           </div></td>
       </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值