Implementation of the javascript drop-down list menu _ javascript skills

Source: Internet
Author: User
This article mainly introduces the implementation of the javascript drop-down list menu, which is encapsulated by table. We know that after each row of the table is full, the next row will be automatically added, complete code is included at the end of the article. If you need it, you can refer to the "Implementation of tree menu display in the javascript drop-down list" menu, but after writing it, I found out that it is not suitable. It requires high precision control and is not very nice. Now we use table as the encapsulation. We know that when each row of the table is full, the next row will be automatically added, which is much better than we did before.
1. After clicking the button, you can coexist (you only need to write different functions)
Dispaly is also set by itself. The parent node is used to operate the child node, and whether the child node is displayed or not;

/* Function open1 (node) {// operate the sibling node through the parent node. After clicking the node, the node can be opened directly. However, when you open a node, all others turn off var nodes = node. parentNode; var nn = nodes. getElementsByTagName ("ul") [0]; with (nn. style) {display = (display = "block ")? "None": "block" ;}}*/script

2. Only one click is allowed, and all others must be disabled.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.