Click the button to hide the sub-menu classic

Source: Internet
Author: User

[Html] <mce: script language = "javascript"> <! -- Var count = 0; // counter var limit = new Array (); // used to record which menus are currently displayed var countlimit = 1; // The number of menus opened at the same time, customizable function expandIt (el) {obj = eval ("" + el); if (obj. style. display = "none") {obj. style. display = "block"; // display the sub-menu if (count <countlimit) {// limit 2 limit [count] = el; // enter the array count ++ ;} else {eval ("" + limit [0]). style. display = "none"; for (I = 0; I <limit. length-1; I ++) {limit [I] = limit [I + 1];} // The array is used to turn around one character, and the next one is moved forward to a limit [limit. length-1] = el ;}} else {obj. style. display = "none"; var j; www.2cto.com for (I = 0; I <limit. length; I ++) {if (limit [I] = el) j = I;} // obtain the position of the currently clicked menu in the limit array for (I = j; I <limit. length-1; I ++) {limit [I] = limit [I + 1];} // All arrays after j are moved forward by one limit [limit. length-1] = null; // Delete the last count --;} of the array // --> </mce: script>

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.