CN104536757A - Multilevel menu implementation method - Google Patents
Multilevel menu implementation method Download PDFInfo
- Publication number
- CN104536757A CN104536757A CN201410848437.0A CN201410848437A CN104536757A CN 104536757 A CN104536757 A CN 104536757A CN 201410848437 A CN201410848437 A CN 201410848437A CN 104536757 A CN104536757 A CN 104536757A
- Authority
- CN
- China
- Prior art keywords
- file
- menu
- array
- implementation method
- asp
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- User Interface Of Digital Computer (AREA)
Abstract
The invention provides a multilevel menu implementation method. The method comprises the steps that S1, a js file is introduced in a main display page index.asp; S2, a multidimensional array is constructed in the js file; S3, array items in the js file are read through Javascript in the page index.asp and displayed in the page index.asp. By the adoption of the technical scheme, in the modifying process of menu items, the multidimensional array of the js file is directly operated, for example, the multidimensional array in the js file just needs to be correspondingly added or deleted for adding or deleting the menu items; as a result, the modifying amount is small, and readability and efficiency are high.
Description
Technical field
The present invention relates to WEB technical field, particularly relate to a kind of implementation method of multilevel menu.
Background technology
Along with the development of front end web technology, people to the access speed of front end page and the requirement of performance more and more higher; Application developer also wishes when the project of catcher, the readability of code and reconstitution good, is convenient to amendment and increases function.
Realize in project concrete, due to the designing requirement of router, router comprises the function of multiple pattern, each functional mode needs the menu bar content of display different, just cause needs for each different pattern, with the form of paragraph write HTML code, then control to show under corresponding modes by the Property ID of the display of Javascript and the HTML code outermost label of hidden function and different paragraph, size of code is very large.
1, because all need to write HTML code for different mode, and control when to show by Javascript, so size of code is very large, readable poor.
2, owing to clicking different menu items, need display different router that function pages is set, so in the html tag of master menu and submenu, all ID property value can be arranged, be controlled to facilitate by the correlation method of Javascript; So a large amount of ID values can be arranged in code, these ID values are all arrange with natural order, so needing when a submenu is added in centre at every turn, just need to modify to all menu ID values after it, change amount is large, reconstitution difference.
Summary of the invention
The technical matters that the present invention need solve overcomes above-mentioned deficiency, provides a kind of implementation method of multilevel menu, comprising:
S1, in main display page index.asp, quote js file;
S2, in js construct a Multidimensional numerical;
S3, in the index.asp page, read the array item in js file by Javascript, be presented in the index.asp page.
Further, described Multidimensional numerical is three-dimensional array.
Further, described Multidimensional numerical is with menu item one_to_one corresponding.
Further, described menu item interpolation or delete by adding or deleting corresponding array realization.
Further, described Javascript reads the array item in js file is read by the For circulation of Javascript.
After adopting technical scheme of the present invention, during amendment menu item, directly the Multidimensional numerical of js file is operated, such as add or delete menu item, only need the interpolation corresponding to the Multidimensional numerical in js file or delete array, change amount is little, readable strong, efficiency is high.
Accompanying drawing explanation
Fig. 1 is the implementation method schematic diagram of multilevel menu provided by the invention.
Embodiment
Technical scheme of the present invention is understood better in order to make relevant technical staff in the field, below in conjunction with the accompanying drawing of embodiment of the present invention, technical scheme in embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.
Below in conjunction with drawings and embodiments, the invention will be further described.
Consult Fig. 1, the implementation method of a kind of multilevel menu provided by the invention, comprises the following steps:
Step S1, quotes js file in main display page index.asp;
Js file is a kind of script, directly can embed html page, but is write as independent js file and be conducive to being separated of structure and behavior.
Step S2, constructs a Multidimensional numerical in js;
A Multidimensional numerical is constructed, corresponding multilevel menu, i.e. the how many grades of corresponding how many dimension groups of menu in js file.
Multidimensional numerical is with menu item one_to_one corresponding.
Array basic structure is as follows:
For the Section 1 of two-dimensional array, menu [0] [0] for further menu title " basic setup "
Menu [0] [1] [0] is second-level menu title " quick-setting ", menu [0] [1] [1] filename corresponding to second-level menu name, needs to use in the click event of script
Above-mentioned two-dimensional array correspondence one has the menu item of second-level menu, " basic setup " and " senior setting " is further menu item, the second-level menu item of corresponding further menu item " basic setup " has " quick-setting " and " system state " two menu items, and the second-level menu item of corresponding further menu item " senior setting " has " wireless setting " and " wireless cipher setting " two menu items.The like, the corresponding Multidimensional numerical of multilevel menu.Because three-stage menu Application comparison is many, in the present embodiment, adopt three-stage menu, therefore the js file of correspondence is three-dimensional array more.
Step S3, in the index.asp page, read the array item in js file by Javascript, be presented in the index.asp page.
Array item in js file needs to be shown as menu item in the index.asp page, by Javascript, the array item in js file is read out in the index.asp page with regard to needing, and the For circulation of the general Javascript of employing is read.
After js file build completes, always have amendment, such as, need interpolation or delete menu item, at this moment, only need the array that position is added or deletion is corresponding corresponding in the Multidimensional numerical of correspondence just can realize.
Illustrate now, a two-dimensional array as above, if need now to delete " wireless cipher setting " this menu item in second-level menu, only need delete " wireless cipher " array of corresponding two-dimensional array correspondence position, as follows after deleting:
In like manner, if need the second-level menu item adding " mac address filtering " in " senior setting " the inside, then the array revised in corresponding js file is as follows:
After adopting technical scheme of the present invention, during amendment menu item, directly the Multidimensional numerical of js file is operated, such as add or delete menu item, only need the interpolation corresponding to the Multidimensional numerical in js file or delete array, change amount is little, readable strong, efficiency is high.
Below only have expressed several embodiment of the present invention, it describes comparatively concrete and detailed, but therefore can not be interpreted as the restriction to the scope of the claims of the present invention.It should be pointed out that for the person of ordinary skill of the art, without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection domain of patent of the present invention should be as the criterion with claims.
Claims (5)
1. an implementation method for multilevel menu, is characterized in that, comprising:
S1, in main display page index.asp, quote js file;
S2, in js construct a Multidimensional numerical;
S3, in the index.asp page, read the array item in js file by Javascript, be presented in the index.asp page.
2. the implementation method of multilevel menu according to claim 1, is characterized in that, described Multidimensional numerical is three-dimensional array.
3. the implementation method of multilevel menu according to claim 1, is characterized in that, described Multidimensional numerical is with menu item one_to_one corresponding.
4. the implementation method of multilevel menu according to claim 3, is characterized in that, the interpolation of described menu item or deletion realize by adding or deleting corresponding array.
5. the implementation method of multilevel menu according to claim 1, is characterized in that, the described Javascript array item read in js file is read by the For circulation of Javascript.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410848437.0A CN104536757A (en) | 2014-12-26 | 2014-12-26 | Multilevel menu implementation method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410848437.0A CN104536757A (en) | 2014-12-26 | 2014-12-26 | Multilevel menu implementation method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104536757A true CN104536757A (en) | 2015-04-22 |
Family
ID=52852289
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410848437.0A Pending CN104536757A (en) | 2014-12-26 | 2014-12-26 | Multilevel menu implementation method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104536757A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105786327A (en) * | 2016-02-23 | 2016-07-20 | 浪潮软件集团有限公司 | Method for rapidly developing APP (application) disc menu of mobile phone |
CN106598591A (en) * | 2016-12-12 | 2017-04-26 | 深圳竹信科技有限公司 | Webpage dynamic menu generation method and device |
CN106649889A (en) * | 2017-01-18 | 2017-05-10 | 深圳市华第时代科技有限公司 | Data display method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1974318A2 (en) * | 2005-12-05 | 2008-10-01 | Bmenu As | System, process and software arrangement for assisting in navigating the internet |
CN101510207A (en) * | 2009-02-26 | 2009-08-19 | 中兴通讯股份有限公司 | Tree menu dynamic maintenance method and apparatus based on web page |
CN102880624A (en) * | 2011-07-16 | 2013-01-16 | 张文广 | Website navigation tool system |
-
2014
- 2014-12-26 CN CN201410848437.0A patent/CN104536757A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1974318A2 (en) * | 2005-12-05 | 2008-10-01 | Bmenu As | System, process and software arrangement for assisting in navigating the internet |
CN101510207A (en) * | 2009-02-26 | 2009-08-19 | 中兴通讯股份有限公司 | Tree menu dynamic maintenance method and apparatus based on web page |
CN102880624A (en) * | 2011-07-16 | 2013-01-16 | 张文广 | Website navigation tool system |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105786327A (en) * | 2016-02-23 | 2016-07-20 | 浪潮软件集团有限公司 | Method for rapidly developing APP (application) disc menu of mobile phone |
CN106598591A (en) * | 2016-12-12 | 2017-04-26 | 深圳竹信科技有限公司 | Webpage dynamic menu generation method and device |
CN106649889A (en) * | 2017-01-18 | 2017-05-10 | 深圳市华第时代科技有限公司 | Data display method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Eriksson et al. | Contagious exploitation of marine resources | |
CN103699576B (en) | A kind of method and apparatus for being used to provide search result | |
CN101630322B (en) | Method for storing and accessing file set under tree directory structure in database | |
CN104317474B (en) | Windows switching method and device | |
CN101771681B (en) | Page display control method, server and system | |
US20160179977A1 (en) | Taxonomy driven site navigation | |
CN104765809A (en) | Preview method and device of search pictures of mobile terminal | |
CN101510207B (en) | Tree menu dynamic maintenance method and apparatus based on web page | |
US20160092566A1 (en) | Clustering repetitive structure of asynchronous web application content | |
CN102830910B (en) | Realize the method and system of touch-screen equipment web page browing pattern | |
CN102520933A (en) | Method and device for establishing tree menu based on user right | |
Ahmed et al. | Geomi: Geometry for maximum insight | |
CN102214079A (en) | Method and device for displaying data of widget | |
CN103324763A (en) | Presenting method for tree-form data structure of mobile phone terminal | |
CN104536757A (en) | Multilevel menu implementation method | |
EP2933731A1 (en) | Method for configuring browser bookmarks, device and terminal thereof | |
CN102662666A (en) | Method and device for creating interface menu | |
CN103345493A (en) | Method, device and system for text content displaying on mobile terminal | |
CN107180041A (en) | Web page content review method and system | |
CN102024182A (en) | System for managing asset information | |
CN103106197A (en) | Method and system for hierarchical data showing | |
CN102741810B (en) | Information management | |
US20150039636A1 (en) | Systems and methods for intelligently linking and formatting genealogical structures | |
CN103795799B (en) | A kind of long-distance monitoring method and system | |
US10366125B2 (en) | Object display system for relationship graph |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
EXSB | Decision made by sipo to initiate substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20150422 |
|
RJ01 | Rejection of invention patent application after publication |