html中隐藏元素的两种方式,以及区别

javascript控制页面控件隐藏显示的两种方法,方法的不同之处在于控件隐藏后是否还在页面上占位
方法一:
document.all["PanelSMS"].style.visibility="hidden"; 
document.all["PanelSMS"].style.visibility="visible";
方法二:
document.all["PanelSMS"].style.display="none"; 
document.all["PanelSMS"].style.display="inline";
方法一隐藏后 页面的位置还被控件占用 只是不显示 
方法二隐藏后 页面的位置不被占用

posted on 2011-07-07 14:12  xuq  阅读(214)  评论(0编辑  收藏  举报

导航