Chinaunix首页 | 论坛 | 博客
  • 博客访问: 341369
  • 博文数量: 329
  • 博客积分: 2633
  • 博客等级: 少校
  • 技术积分: 3633
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-22 15:43
文章分类

全部博文(329)

文章存档

2013年(244)

2012年(46)

2011年(39)

我的朋友

分类:

2011-08-07 16:41:34

用变换显示div的方法实现标签页的效果。







javascript用:
  1. <script type="text/javascript">
  2.   function showXttx(){
  3.      document.getElementById("divDxls").style.display="none";
  4.      document.getElementById("divGxdz").style.display="none";
  5.      document.getElementById("divXttx").style.display="";
  6.      parent.showXttx();
  7.     
  8.   }
  9.   function showDxls(){
  10.      document.getElementById("divDxls").style.display="";
  11.      document.getElementById("divGxdz").style.display="none";
  12.      document.getElementById("divXttx").style.display="none";
  13.      parent.showDxls();
  14.   }
  15.   function showGxdz(){
  16.      document.getElementById("divDxls").style.display="none";
  17.      document.getElementById("divGxdz").style.display="";
  18.      document.getElementById("divXttx").style.display="none";
  19.      parent.showUserSetting();
  20.   }
  21. </script>
jsp中写入:
  1. <body leftmargin=0 topmargin=0 >
  2. <div id="divXttx" style="">
  3. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  4.   <tr>
  5.   <td width="90" height="24" align="center" valign="middle">
  6.        <table width="80" border="0" cellspacing="0" cellpadding="0">
  7.               <tr>
  8.                 <td width="24" align="center" valign="middle"><img src="<%=s.get("img") %>/images/jyb/cm/application_edit (2).png" alt="" width="16" height="16" /></td>
  9.                 <td align="left" valign="middle"><span class="ann">协同通讯</span></td>
  10.               </tr>
  11.             </table></td>
  12.             <td width="1" bgcolor="#7492B1"></td>
  13.             <td width="89" align="center" valign="middle" style="cursor:pointer" onclick="showDxls()" background="<%=s.get("img") %>/images/jyb/cm/bj0727.png"><table width="80" border="0" cellspacing="0" cellpadding="0">
  14.               <tr>
  15.                 <td width="24" align="center" valign="middle"><img src="<%=s.get("img") %>/images/jyb/cm/book_open (2).png" alt="" width="16" height="16" /></td>
  16.                 <td align="left" valign="middle"><span class="ann">短信历史</span></td>
  17.               </tr>
  18.             </table></td>
  19.             <td width="1" bgcolor="#7492B1"></td>
  20.             <td width="89" align="center" valign="middle" style="cursor:pointer" onclick="showGxdz()" background="<%=s.get("img") %>/images/jyb/cm/bj0727.png"><table width="80" border="0" cellspacing="0" cellpadding="0">
  21.               <tr>
  22.                 <td width="24" align="center" valign="middle"><img src="<%=s.get("img") %>/images/jyb/cm/application_view_tile (2).png" alt="" width="16" height="16" /></td>
  23.                 <td align="left" valign="middle"><span class="ann">个性定制</span></td>
  24.                 </tr>
  25.             </table></td>
  26.             <td width="1" bgcolor="#7492B1"></td>
  27.          <td width="*" bgcolor="#F2F2F2">&nbsp;</td>
  28.             </tr>
  29.           <tr>
  30.             <td height="1" bgcolor="#FFFFFF"></td>
  31.             <td height="1" bgcolor="#7492B1"></td>
  32.             <td height="1" bgcolor="#7492B1"></td>
  33.             <td height="1" bgcolor="#7492B1"></td>
  34.             <td height="1" bgcolor="#7492B1"></td>
  35.             <td bgcolor="#7492B1"></td>
  36.             <td bgcolor="#7492B1"></td>
  37.             </tr>
  38.         </table>
  39.         
  40.         </div>




  41. <div id="divDxls" style="display:none">
  42. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  43.   <tr>
  44.   <td width="90" height="24" align="center" valign="middle" style="cursor:pointer" onclick="showXttx()" background="<%=s.get("img") %>/images/jyb/cm/bj0727.png">
  45.        <table width="80" border="0" cellspacing="0" cellpadding="0">
  46.               <tr>
  47.                 <td width="24" align="center" valign="middle"><img src="<%=s.get("img") %>/images/jyb/cm/application_edit (2).png" alt="" width="16" height="16" /></td>
  48.                 <td align="left" valign="middle"><span class="ann">协同通讯</span></td>
  49.               </tr>
  50.             </table></td>
  51.             <td width="1" bgcolor="#7492B1"></td>
  52.             <td width="89" align="center" valign="middle"><table width="80" border="0" cellspacing="0" cellpadding="0">
  53.               <tr>
  54.                 <td width="24" align="center" valign="middle"><img src="<%=s.get("img") %>/images/jyb/cm/book_open (2).png" alt="" width="16" height="16" /></td>
  55.                 <td align="left" valign="middle"><span class="ann">短信历史</span></td>
  56.               </tr>
  57.             </table></td>
  58.             <td width="1" bgcolor="#7492B1"></td>
  59.             <td width="89" align="center" valign="middle" style="cursor:pointer" onclick="showGxdz()" background="<%=s.get("img") %>/images/jyb/cm/bj0727.png"><table width="80" border="0" cellspacing="0" cellpadding="0">
  60.               <tr>
  61.                 <td width="24" align="center" valign="middle"><img src="<%=s.get("img") %>/images/jyb/cm/application_view_tile (2).png" alt="" width="16" height="16" /></td>
  62.                 <td align="left" valign="middle"><span class="ann">个性定制</span></td>
  63.                 </tr>
  64.             </table></td>
  65.             <td width="1" bgcolor="#7492B1"></td>
  66.          <td width="*" bgcolor="#F2F2F2">&nbsp;</td>
  67.             </tr>
  68.           <tr>
  69.             <td height="1" bgcolor="#7492B1"></td>
  70.             <td height="1" bgcolor="#7492B1"></td>
  71.             <td height="1" bgcolor="#FFFFFF"></td>
  72.             <td height="1" bgcolor="#7492B1"></td>
  73.             <td height="1" bgcolor="#7492B1"></td>
  74.             <td bgcolor="#7492B1"></td>
  75.             <td bgcolor="#7492B1"></td>
  76.             </tr>
  77.         </table>
  78.         
  79.         </div>





  80. <div id="divGxdz" style="display:none">
  81. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  82.   <tr>
  83.           <td width="90" height="24" align="center" valign="middle" style="cursor:pointer" onclick="showXttx()" background="<%=s.get("img") %>/images/jyb/cm/bj0727.png">
  84.                <table width="80" border="0" cellspacing="0" cellpadding="0">
  85.               <tr>
  86.                 <td width="24" align="center" valign="middle"><img src="<%=s.get("img") %>/images/jyb/cm/application_edit (2).png" alt="" width="16" height="16" /></td>
  87.                 <td align="left" valign="middle"><span class="ann">协同通讯</span></td>
  88.               </tr>
  89.             </table>
  90.         </td>
  91.         <td width="1" bgcolor="#7492B1"></td>
  92.         <td width="89" align="center" valign="middle" style="cursor:pointer" onclick="showDxls()" background="<%=s.get("img") %>/images/jyb/cm/bj0727.png">
  93.             <table width="80" border="0" cellspacing="0" cellpadding="0">
  94.               <tr>
  95.                 <td width="24" align="center" valign="middle"><img src="<%=s.get("img") %>/images/jyb/cm/book_open (2).png" alt="" width="16" height="16" /></td>
  96.                 <td align="left" valign="middle"><span class="ann">短信历史</span></td>
  97.               </tr>
  98.             </table>
  99.         </td>
  100.         <td width="1" bgcolor="#7492B1"></td>
  101.         
  102.         <td width="89" align="center" valign="middle" bgcolor="#FFFFFF">
  103.           <table width="80" border="0" cellspacing="0" cellpadding="0">
  104.               <tr>
  105.                 <td width="24" align="center" valign="middle"><img src="<%=s.get("img") %>/images/jyb/cm/application_view_tile (2).png" alt="" width="16" height="16" /></td>
  106.                 <td align="left" valign="middle"><span class="ann">个性定制</span></td>
  107.                 </tr>
  108.             </table>
  109.          </td>
  110.          <td width="1" bgcolor="#7492B1"></td>
  111.          <td width="*" bgcolor="#F2F2F2">&nbsp;</td>
  112.    </tr>
  113.           <tr>
  114.             <td height="1" bgcolor="#7492B1"></td>
  115.             <td bgcolor="#7492B1"></td>
  116.             <td bgcolor="#7492B1"></td>
  117.             <td bgcolor="#7492B1"></td>
  118.             <td bgcolor="#FFFFFF"></td>
  119.             <td bgcolor="#7492B1"></td>
  120.             <td bgcolor="#7492B1"></td>
  121.             
  122.             </tr>
  123.         </table>
  124.         
  125.         </div>
  126. </body>




阅读(2577) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~