Home >Web Front-end >JS Tutorial >Simple implementation of hiding/showing JavaScript column list_javascript skills

Simple implementation of hiding/showing JavaScript column list_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 17:38:341236browse
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 ="Simple implementation of hiding/showing JavaScript column list_javascript skills";

}
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




Simple implementation of hiding/showing JavaScript column list_javascript skills

This is the content area



Statement:
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