您的位置:首页 > Web前端 > JavaScript

javascript控制页面控件隐藏显示的两种方法

2006-12-04 14:21 981 查看
function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}



javascript控制页面控件隐藏显示的两种方法

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";


方法一隐藏后 页面的位置还被控件占用 只是不显示 类似于.net验证控件的Display=Static


方法二隐藏后 页面的位置不被占用 类似于.net验证控件的Display=Dynamic
function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: