Use ASP to implement homepage with dynamic scaling level list
Source: Internet
Author: User
The IE4.X released by Microsoft has made web pages created in accordance with the HTML4 standard fashionable for the moment. Such web pages have greatly improved their dynamic functions. In particular, you can use Script statements embedded in the page to display any piece of text on the page as needed and hide it when not needed, you can design a scalable hierarchy list on the page. This type of list actually represents a hierarchical tree structure. You can click an entry on the previous layer and expand or collapse the next layer. After understanding the DOM implementation mechanism in the HTML4 standard and the definition of the style form, it is easy to find a way to implement this list. However, in general, there are many entries in this list. If you use manual production every time, it is not only cumbersome, but also very error-prone. Therefore, it must be applied to actual page creation, there must also be a more automatic method. Through my experiment, I completed a general implementation process in ASP mode, which can be applied to various homepage production processes with slight changes, which is very convenient, here I will write it out and give it to everyone. I hope you can give more comments.
Simple implementation
To scale a webpage, you must first understand how to hide and display a piece of text on the page as needed. Let's take a look at the following HTML snippet:
<Div Id = "test" Style = "Display: none"> text to be hidden </Div>
This is an HTML statement conforming to the HTML4 standard. The text clipped between <Div> is not displayed on the page because the Display attribute of the style form is none. (This article does not mainly introduce HTML 4 style forms. For more information, see .) As long as the Display attribute can be set to null dynamically, that is, the default value, the text can be displayed dynamically. This requires Script support. The following are two JavaScript functions that display and hide the above text. You only need to substitute the Id value of the custom Div, the corresponding text is displayed or hidden:
<Script language = "JavaScript">
Function ShowDiv (DivId)
{
Document. all [DivId]. style. display = '';
Return 0;
}
</Script>
Function HideDiv (DivId)
{
Document. all [DivId]. style. display = 'none ';
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