- subdirectory 1
- subdirectory 2
- subdirectory 3 a >
- subdirectory 4 div>
- subdirectory 2
- subdirectory 3 a >
- subdirectory 4 div>
main directory 2 div>
< A href = "#"> - subdirectory 1
- subdirectory 2
- subdirectory 3 < / a> div> Note: "Represents a character space 1, first define two DIVs, one for the main directory, named: main1; another sub-directory for the corresponding sub-directory is named: Child1. 2. Write " Main Catalog 1" in the DIV of Main1, and load a mouse on its top: OnClick and a small JavaScript program: Document.all.Child1.Style.display = (Document.All. Child1.Style.Display == 'none')? '': 'none'. The role of this program is that when the mouse is on the MAIN1 DIV (i.e., " Main Catalog 1"), if Child1's DIV is hidden, let it display; if it is displayed, let it hide . 3. Write a subdirectory on the DIV of Child1 and set it into a hyperlink. I am setting an empty link in the above example. When the actual production is made to real link to let it point to the link target. Plus a CSS: Style = "Display: None" in the DIV definition of Child1, which is a hidden state when the subdirector is started. The production of other directories is just repeating the above three steps. It can be seen in F12. This method mainly uses the display attribute of CSS: Display, it has a feature that the page space occupied by the object will be automatically made when the object is hidden. We know that CSS is still an attribute: Visibility also has the function of displaying and hidden objects, but cannot be used to make the above tree directory.
- subdirectory 2
- subdirectory 3 < / a> div> Note: "Represents a character space 1, first define two DIVs, one for the main directory, named: main1; another sub-directory for the corresponding sub-directory is named: Child1. 2. Write " Main Catalog 1" in the DIV of Main1, and load a mouse on its top: OnClick and a small JavaScript program: Document.all.Child1.Style.display = (Document.All. Child1.Style.Display == 'none')? '': 'none'. The role of this program is that when the mouse is on the MAIN1 DIV (i.e., " Main Catalog 1"), if Child1's DIV is hidden, let it display; if it is displayed, let it hide . 3. Write a subdirectory on the DIV of Child1 and set it into a hyperlink. I am setting an empty link in the above example. When the actual production is made to real link to let it point to the link target. Plus a CSS: Style = "Display: None" in the DIV definition of Child1, which is a hidden state when the subdirector is started. The production of other directories is just repeating the above three steps. It can be seen in F12. This method mainly uses the display attribute of CSS: Display, it has a feature that the page space occupied by the object will be automatically made when the object is hidden. We know that CSS is still an attribute: Visibility also has the function of displaying and hidden objects, but cannot be used to make the above tree directory.
转载请注明原文地址:https://www.9cbs.com/read-29896.html
New Post(0)