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

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

WBOY
WBOYOriginal
2016-05-16 18:35:351010browse
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:


3



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. . .
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
Previous article:JavaScript Study Notes (15)_Basic KnowledgeNext article:JavaScript Study Notes (15)_Basic Knowledge

Related articles

See more