百度空间 | 百度首页 
 
查看文章
 
隐藏div实际使用
2008-06-13 15:14

隐藏并且不占位
<div id="mmm">
插入FLASH动画<br>
插入FLASH动画<br>
插入FLASH动画<br>
插入FLASH动画<br>
插入FLASH动画<br>
</div>
<input type="button" name=hiddendiv value="隐藏" onClick="javascript:return document.all.mmm.style.display='none'">
<input type="button" name=showdiv value="显示"onClick="javascript:return document.all.mmm.style.display='block'">

隐藏但是DIV所占的位置保持空白
<div id="mmm" style="background:#cccccc;">
插入FLASH动画<br>
插入FLASH动画<br>
插入FLASH动画<br>
插入FLASH动画<br>
插入FLASH动画<br>
</div>
<input type="button" name=hiddendiv value="隐藏" onClick="javascript:return document.all.mmm.style.visibility='hidden'">
<input type="button" name=showdiv value="显示"onClick="javascript:return document.all.mmm.style.visibility='visible'">

复选框控制层的显隐
<input type=checkbox onclick="tt.style.display=this.checked?'':'none'"><br>
<div id=tt style="display:none;background-color:pink;width:400;height:400;"></div>

demo.html

<html>
   <body>
      <div id='a' style="display='none';" >
     rerr3545e
   </div>
    <div id='b'>
    <table BORDER=2 CELLPADDING=2 CELLSPACING=4>
     <tr>
       <td>abc</td>
    <td>abc23</td>
     </tr>
     <tr style="display='none';">
       <td>abc2</td>
    <td>abc3</td>
     </tr>
   </table>
   </div>
    <div id='c'><table BORDER=2 CELLPADDING=2 CELLSPACING=4>
     <tr>
       <td>abc</td>
    <td style="display='none';">abc2</td>
     </tr>
   </table></div>
   </body>
</html>


类别:Html | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu