Using PHP to implement a simple sliding menu

Source: Internet
Author: User

<style>
Table {font-size = 9pt}
td {Height = 20px}
</style>
<body>
<span id= "Menus" ></span>
<span id= "View" ></span>
</body>
<script For=pad event=onclick>
Large class Node Click Response
for (var i=1;i<this.parentelement.rows.length;i =2)
This.parentelement.rows[i].style.display = "None";
This.parentelement.rows[this.rowindex 1].style.display= ' block ';
view.innerhtml = this.v1 ":" THIS.V2; Construct the corresponding action according to the size class
</script>
<script For=bar event=onclick>
Small class Node Click response
view.innerhtml = this.v1 ":" THIS.V2; Construct the corresponding action according to the size class
</script>
<script>
/**
* The HTML code string that produces the menu
* Entry parameter is the large class number that the menu opens by default
*/
function menu (n) {
this.ar = new Array (
/**
* Parameter array
* Column 1: Large category
* Column 2: small category
* Column 3: Title
*/
New Array (1, 0, "big Class One"),
New Array (1, 1, "small Class One"),
New Array (1, 2, "small Class Two"),
New Array (2,0, "big Class Two"),
New Array (2,1, "small Class One"),
New Array (2,2, "small Class Two"),
New Array (2,3, "small class three"),
New Array (3,0, "big Class three"),
New Array (3,1, "small Class One"),
New Array (3,2, "small Class Two"),
New Array (4,0, "big Class Four"),
New Array (4,1, "small Class One"),
New Array (4,2, "small Class Two"),
New Array (4,3, "small Class three")
);
This.width = 120;
This.bgcolor = "#f0f0f0";
This.bordercolorlight = "#c0c0c0";
This.bordercolordark = "#FFFFFF";
This.tr_bgcolor = "#d0d0d0";
var s = "<table border=1 align=center width=" this.width "bgcolor=" This.bgcolor "bordercolorlight=" This.bordercolor Light "bordercolordark=" This.bordercolordark "cellpadding=0 cellspacing=0>"
for (Var i=0;i<this.ar.length;i) {///construct the HTML structure of the menu, where the size class number is used as a custom parameter for the event response.
if (this.ar[i][1] = = 0) {
if (i > 0)
s = "</table></td></tr>";
var VK = This.ar[i][0]==n? " Block ": none";
s = "<tr id= ' pad ' bgcolor=" This.tr_bgcolor "v1=" this.ar[i][0 "" v2= "this.ar[i][1]" ><td align=center> "thi S.AR[I][2] "</td></tr><tr style= ' Display:" VK "><td><table width=100%>";
}else
s = "<tr><td id= ' bar ' v1=" this.ar[i][0] "v2=" this.ar[i][1 "" > "this.ar[i][2" "</td></tr>";
}
s = "</table></td></tr></table>";
return s;
}
/*** Create Menu ***/
menus.innerhtml = menu (4);
</script>

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.