Home > Web Front-end > JS Tutorial > Solution to js multi-level menu dynamic on the left_javascript skills

Solution to js multi-level menu dynamic on the left_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 18:35:35
Original
1069 people have browsed it
Copy code The code is as follows:



 



The category appears twice. Click the parent to display (hide) the child menu, JS code Just one sentence:
Copy code The code is as follows:

function news_pro(o)
{
var obj=document.getElementById(o)
obj.style.display==""? obj.style.display="none": obj.style.display="";
}

Isn’t it a bit too simple? Yes, it’s that simple, but it’s not over yet. Let’s continue reading; then add third-level and fourth-level submenus:
Copy code The code is as follows:





I believe this code does not manage asp or There is not much difference in ASP.NET. In fact, it can also be done with pure JS. But since it is used in ASP, why do you need to write more JS? Ok, the function is implemented. Everyone is OK. If you have a different method, please post it and share it with everyone. Progress from learning. . .
Related labels:
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
Latest Issues
Where is js written?
From 1970-01-01 08:00:00
0
0
0
js file code not found
From 1970-01-01 08:00:00
0
0
0
js addClass not working
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template