In this paper, we illustrate the common functions of multiple layer switching effects of javascript implementation. Share to everyone for your reference. The implementation methods are as follows:
function Changediv (tagid,tagname,divid,divname,zdivcount,tagclass,divclass) {for
(i=0;i<=zdivcount;i++) {
document.getElementById (divname+i). style.display= "None";
document.getElementById (divname+i). Classname= ';
document.getElementById (tagname+i). Classname= ';
}
document.getElementById (divname+divid). style.display= "Block";
document.getElementById (Tagname+tagid). Classname=tagclass;
document.getElementById (Divname+divid). Classname=divclass;
Tagid,tagname the ID and name of the control layer for the mouse click Divid,divname the ID and name of the layer that is being controlled to display and hide Zdivcount as the number of layers to display and hide-1 (4 for 5 layers)
Tagclass,divclass is the style of the control layer and the style of the controlled layer respectively
I hope this article will help you with your JavaScript programming.