返回- 首页-代码

居中显示文字框代码

2016-09-10 03:38:27 -0400
代码演示
HTML代码
<TEXTAREA NAME="mytxt" ROWS="5" COLS="25" WRAP="soft" onselect="storePos(this);" onclick="storePos(this);" onkeyup="storePos(this);">
<style type="text/css">
.menutitle{
cursor:pointer;
margin:5px 2px;
background:#C4E1FF;
color:#fff;
padding:5px 3px;
text-align:center;
font-weight:bold;
border:2px solid #ACD6FF;
}
.submenu{
background:#fff;
border-radius:5px;
-webkit-border-radius:5px;
-moz-border-radius:5px;
margin:5px 5px;
padding:5px 4px;
color:#000;
}
</style>
<script type="text/javascript">
if (document.getElementById){
document.write('<style type="text/css">\n');
document.write('.submenu{display: none;}\n');
document.write('</style>\n');
}
function SwitchMenu(obj){
if(document.getElementById){
var el = document.getElementById(obj);
var ar = document.getElementById("masterdiv").getElementsByTagName("span");
if(el.style.display != "block"){
for (var i=0; i<ar.length; i++){
if (ar[i].className=="submenu")
ar[i].style.display = "none";
}
el.style.display = "block";
}else{
el.style.display = "none";
}
}
}
</script>
<div id="masterdiv">
<div class="menutitle" onclick="SwitchMenu('sub1')">输入内容</div>
</TEXTAREA>
<br />

【本站资源属于网页搜集或原创,版权归原作者所有】
«Newer      Older»
Comment:
Name:

Back to home

Subscribe | Register | Login | N