This article for your collection of three about JS control display and hide CSS Tutorial div Code Oh, if you are doing show with hidden layer effect, here are jquery and JS control method Oh.
function Showtips Tutorial (tips, height, time) {
var windowwidth = document.documentelement.clientwidth;
var tipsdiv = ' <div class= ' tipsclass ' > ' + tips + ' </div> ';
$ (' body '). Append (Tipsdiv);
$ (' Div.tipsclass '). CSS ({
' Top ': Height + ' px ',
' Left ': (WINDOWWIDTH/2)-(Tips.length * 13/2) + ' px ',
' Position ': ' Differs ',
' Padding ': ' 3px 5px ',
' Background ': ' #8fbc8f ',
' Font ': + ' px ',
' Margin ': ' 0 auto ',
' Text-align ': ' Center ',
' Width ': ' Auto ',
' Color ': ' #fff ',
' Opacity ': ' 0.8 '
). Show ();
settimeout (function () {$ (' Div.tipsclass '). fadeout ();}, (Time * 1000));
}
Method Two
<html>
<head>
<meta http-equiv= "Content-type content=" HTML; charset=gb2312 "/>
<title> Untitled Document </title>
<mce:script language= "Web Effects" type= "Text/javascript" ><!--
function Toggle (targetid) {
if (document.getElementById)
{
Target=document.getelementbyid (Targetid);
if (target.style.display== "block")
{
target.style.display= "None";
var aaa =document.all ("AA");
var s= ';
for (var i=0;i<aaa.length;i++)
{
if (aaa[i].checked==true)
{
S+=aaa[i].value;
}
}
else
{
target.style.display= "Block";
}
}
}
//--></mce:script>
<mce:style type= "text/css" ><!--
#div1 {
height:400px;
width:400px;
Display:none;
}
--></mce:style><style type= "Text/css" mce_bogus= "1" >
#div1 {
height:400px;
width:400px;
Display:none;
}</style>
</head>
<body>
<input type= "button" id= "Butn" value= "Show/Hide" onclick= "toggle (' Div1 ')"/>
<center>
<div id= "Div1 style=" Filter:alpha (opacity=100); Position:absolute; overflow:auto;height:160; top:100px2008-5-26;left:300px;width:100px; ">
Hidden Div
</div></center>
-Centered Div
</body>
</html>
Method Three
<!doctype HTML Public-//w3c//dtd XHTML 1.0 transitional//en "<a href=" http://www.w3.org/tr/xhtml1/dtd/ Xhtml1-transitional.dtd "target=" _blank "rel=" external ">http://www.w3.org/tr/xhtml1/dtd/" Xhtml1-transitional.dtd</a> ""
<html xmlns= "<a href=" http://www.w3.org/1999/xhtml "target=" _ Blank "rel=" external ">http://www.w3.org/1999/xhtml</a>"
<head>
<meta http-equiv= " Content-type "content=" HTML; charset=gb2312 "/>
<title>jexm's blog</title>
<script language=" JavaScript type= "text/ JavaScript
<!--
Function Show (Targetid) {
if (document.getElementById) {
Target=document.getelementbyid (Targetid);
if (target.style.display== "block") {
Target.style.display = None";
newsinfo.style.height= "1528px"
} else {
target.style.display= "Block";
newsinfo.style.height= "1583px"
}
}
<style
</script>
type= "Text/css"
< !--
#test1 {
Display:none;
}
;
</style>
</head>
<body>
<input name= "niming" type= checkbox "onclick=" Show (' test1 ') "checked > Display or not
<div id= "test1" ><img src= "/logo.gif" border= "0" align= "absmiddle"/></div>
</body>
</html>