1. Building a JavaScript Library
Copy Code code as follows:
(function () {
Registering a namespace IC with Windows
window[' Jshide ']={};
Hides the sidebar and replaces the picture with the right arrow picture
function YC ()
{
document.getElementById ("Cloone"). Style.display = "None";
document.getElementById ("img"). InnerHTML = " ';
}
window[' jshide ' [' YC ']=yc;
Display the sidebar and replace the picture with the left arrow
function xs ()
{
document.getElementById ("Cloone"). Style.display = "";
document.getElementById ("img"). InnerHTML = " ';
}
window[' jshide ' [' xs ']=xs;
})();
2. Insert the JS file into the HTML file:
Insert--HTML--Script Object---script, and then insert it into an HTML file after selecting a good script file.
3.HTML File Code
Copy Code code as follows:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title>javascript column Mode </title>
<script language= "JavaScript" type= "Text/javascript" src= "Js/jshide.js" ></script>
<body>
<table width= "425" height= "198" border= "1" >
<tr>
<TD id= "Cloone" width= "align=" "Center" valign= "middle" scope= "Row" >
<p><a href= "if test. html" target= "_blank" > Column one </a></p>
<p><a href= "for loop. html" target= "_blank" > section two </a></p>
<p><a href= "CSS preliminary discoloration disappears. html" target= "_blank" > column three </a></p>
<p><a href= "1 Add to 100.html" target= "_blank" > column four </a></p>
<p><a href= "JS preliminary. html" target= "_blank" > section five </a></p>
</td>
<TD width= "102" align= "center" valign= "Middle" >
<span id= "img" >
</span>
</td>
<TD width= "align=" "Center" valign= "Middle" > here is the content area </td>
<TD width= "169" align= "center" valign= "middle" ><input type= "text" name= "TextField" id= "txtID" value= "Yesle"/ ></td>
</tr>
</table>
</body>