Home > Web Front-end > JS Tutorial > body text

Simple implementation of hiding/showing JavaScript column list_javascript skills

WBOY
Release: 2016-05-16 17:38:34
Original
1133 people have browsed it
1. Build JavaScript library
Copy the code The code is as follows:

( function(){

//Register the namespace IC to window
window['JSHide']={};

//Hide the sidebar and replace the image with Right arrow image
function yc()
{
document.getElementById("cloone").style.display ="none";
document.getElementById("img").innerHTML ="< ;img src='Image/right arrow.png' width='10' height='10' longdesc='Image/right arrow.png' onclick='JSHide.xs()' />";

}
window['JSHide']['yc']=yc;

//Show the sidebar and change the image to 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", select the script file and insert it into the HTML file.
3.HTML file code
Copy code The code is as follows:





javascript column mode











Column 1


Column 2


Column 3

Column 4


Column 5






This is the content area


< /html>
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template