|
Blue Forest http://www.lslnet.com at 6:28 p.m. on August 22, 2006
My tutor on the menu tree [DWMX 2004] I. Background :
[DWMX Tutor 2004] LeXRus wrote in a menu tree based on, I had a slight optimization of the process, which I think it is necessary to amend some of the places to do some simple changes. Of course, everyone's different needs, the requirements of the process is different, but we can write down their ideas and learn from each other, I wrote out the hope of more!
I think the procedure should be amended to the following areas : original
1, the application process with fewer {}, to some extent affect the readability for beginners is an obstacle.
2, a printed menu in the form of the website is a start, we usually need it in the beginning of the contraction. (Of course, you can also start here mainly for the provision of such practices)
3, onmouseUp incident wording is too cumbersome and inefficient. Function Call it re-form.
4, onmouseUp incident this.styple function used to make sentences lower readability.
More than just his own views, for reference purposes only, if you do not see the need, please stop reading this.
Second, code trip.
Note : Red Department revised the original procedure.
[code]
"Html>
"Head are
"Title> tree menu" /title>
"Script language=" JavaScript ""
4003rd Example : obj = findObj ( "image1");
Function findObj (theObj, theDoc)
{
Var p, i, foundObj;
If (!theDoc) theDoc = document;
If ((p = theObj.indexOf ( "? "))", Named parent.frames.length 0)
{
Parent.frames[theObj.substring theDoc = (p + 1) ].document;
TheObj.substring theObj = (0, p);
}
If (! (FoundObj = theDoc[theObj]) & theDoc.all) foundObj = theDoc.all[theObj];
For (i i=0; !foundObj, named "theDoc.forms.length; i++)
FoundObj = theDoc.forms[i][theObj];
For (i i=0; !foundObj, named theDoc.layers, named "theDoc.layers.length; i++)
FoundObj = findObj (theObj, theDoc.layers[i].document);
If (!foundObj, named document.getElementById) foundObj = document.getElementById (theObj);
Return foundObj;
}
[color=Red]
Function ShowHide (ObjectId)
{
With (findObj (ObjectId))
{
If (style.display== 'none') (
Style.display= '';
Document.all.tags ( "tr")
Event.srcElement.style.backgroundImage= 'government payments are capped (e.gif)' ;}
Else
{style.display= 'None';
Event.srcElement.style.backgroundImage= 'government payments are capped (c.gif)' ;}
}
}[/color]
"/script>
"Style type=" text/css ""
<!--
. Emenu --
Background-image : government payments are capped (c.gif);
Background-repeat : no-repeat;
Padding-left : 40px;
Cursor : hand;
}
. Submenu --
Padding-left : 24px;
}
. Files --
Background-image : government payments are capped (ie.gif);
Background-repeat : no-repeat;
Cursor : hand;
Padding-left : 18px;
}
-->
"/style>
"/head>
"Body>
Tree Menu
"Hr>
"Width= table" 200 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td height=" 19 "formal" emenu "[color=Red]
OnMouseUp= "ShowHide ( 'Buleidea')" [/color]>Buleidea</td>
"Per
"Tr>
"Td formal" submenu "filled="f"" Buleidea "[color=Red]style=" display : none "[/color]>
"Width= table" 200 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td height=" 18 "formal" emenu "[color=Red]onMouseUp=" ShowHide ( 'Contents') "[/color]>Contents</td>
"Per
"Tr>
"Td formal" submenu "filled="f"" Contents "[color=Red] Historic Significance of the Transitional Budget" display : none "[/color]>" table width= "200" cellpadding= "0" cellspacing "0" "
"Tr>
"Td formal" files "and" <a style='mso-footnote-id:ftn1' "http://www.buleidea.com" target= "_blank" "Javascirpt</a></td>
"Per
"Tr>
"Td formal" files "and" <a style='mso-footnote-id:ftn1' "http://www.tute.edu.cn" target= "_blank" "Flash</a></td>
"Per
"Tr>
"Td formal" files "and" Photoshop</td>
"Per
"/table></td>
"Per
"/table></td>
"Per
"Tr>
"Td height=" 18 "formal" emenu "[color=Red]onMouseUp=" ShowHide ( 'Douguoqiang') "[/color]>Douguoqiang</td>
"Per
"Tr>
"Td formal" submenu "filled="f"" Douguoqiang "[color=Red]style=" display : none "[/color]>
"Width= table" 226 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td width=" 224 "formal" files "and" <a style='mso-footnote-id:ftn1' "http : //211.81.22.61/homepage/douguoq/zddh.html "target=" _blank "" Homepage</a></td>
"Per
"Tr>
"Td formal" files "and" Secondpage</td>
"Per
"/table></td>
"Per
"Tr>
"Td height=" 19 "formal" emenu "[color=Red]onMouseUp=" ShowHide ( '51windows') "[/color]>51windows</td>
"Per
"Tr>
"Td formal" submenu "filled="f"" 51windows "[color=Red]style=" display : none "[/color]>
"Width= table" 200 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td height=" 18 "formal" emenu "[color=Red] onMouseUp=" ShowHide ( 'Contents2') "[/color]>Contents2</td>
"Per
"Tr>
"Td formal" submenu "filled="f"" Contents2 "[color=red]style=" display : none "[/color]>
"Width= table" 200 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td formal" files "and" <a style='mso-footnote-id:ftn1' "http://www.buleidea.com" target= "_blank" "Javascirpt</a></td>
"Per
"Tr>
"Td formal" files "and" <a style='mso-footnote-id:ftn1' "http://www.tute.edu.cn" target= "_blank" "Flash</a></td>
"Per
"Tr>
"Td formal" files "and" Photoshop</td>
"Per
"/table></td>
"Per
"/table></td>
"Per
"ShapeID="_x0000_i1025" DrawAspect="Content" ObjectID="_1127825915"> </o:OLEObject>
"/body>
"/html>
[/code]
Third, the operation of firms.
[html]
"Html>
"Head are
"Title> tree menu" /title>
"Script language=" JavaScript ""
4003rd Example : obj = findObj ( "image1");
Function findObj (theObj, theDoc)
{
Var p, i, foundObj;
If (!theDoc) theDoc = document;
If ((p = theObj.indexOf ( "? "))", Named parent.frames.length 0)
{
Parent.frames[theObj.substring theDoc = (p + 1) ].document;
TheObj.substring theObj = (0, p);
}
If (! (FoundObj = theDoc[theObj]) & theDoc.all) foundObj = theDoc.all[theObj];
For (i i=0; !foundObj, named "theDoc.forms.length; i++)
FoundObj = theDoc.forms[i][theObj];
For (i i=0; !foundObj, named theDoc.layers, named "theDoc.layers.length; i++)
FoundObj = findObj (theObj, theDoc.layers[i].document);
If (!foundObj, named document.getElementById) foundObj = document.getElementById (theObj);
Return foundObj;
}
Function ShowHide (ObjectId)
{
With (findObj (ObjectId))
{
If (style.display== 'none') (
Style.display= '';
Document.all.tags ( "tr")
Event.srcElement.style.backgroundImage= 'government payments are capped (http://lexrus.com/Tutor/FileMenu/e.gif)' ;}
Else
{style.display= 'None';
Event.srcElement.style.backgroundImage= 'government payments are capped (http://lexrus.com/Tutor/FileMenu/c.gif)' ;}
}
}
"/script>
"Style type=" text/css ""
<!--
. Emenu --
Background-image : government payments are capped (http://lexrus.com/Tutor/FileMenu/c.gif);
Background-repeat : no-repeat;
Padding-left : 40px;
Cursor : hand;
}
. Submenu --
Padding-left : 24px;
}
. Files --
Background-image : government payments are capped (http://lexrus.com/Tutor/FileMenu/ie.gif);
Background-repeat : no-repeat;
Cursor : hand;
Padding-left : 18px;
}
-->
"/style>
"/head>
"Body>
Tree Menu
"Hr>
"Width= table" 200 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td height=" 19 "formal" emenu "onMouseUp=" ShowHide ( 'Buleidea'), "" Buleidea</td>
"Per
"Tr>
"Td formal" submenu "filled="f"" Buleidea "Historic Significance of the Transitional Budget" display : none "and" the "table width=" 200 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td height=" 18 "formal" emenu "onMouseUp=" ShowHide ( 'Contents'), "" Contents</td>
"Per
"Tr>
"Td formal" submenu "filled="f"" Contents "Historic Significance of the Transitional Budget" display : none "and" the "table width=" 200 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td formal" files "and" <a style='mso-footnote-id:ftn1' "http://www.buleidea.com" target= "_blank" "Javascirpt</a></td>
"Per
"Tr>
"Td formal" files "and" <a style='mso-footnote-id:ftn1' "http://www.tute.edu.cn" target= "_blank" "Flash</a></td>
"Per
"Tr>
"Td formal" files "and" Photoshop</td>
"Per
"/table></td>
"Per
"/table></td>
"Per
"Tr>
"Td height=" 18 "formal" emenu "onMouseUp=" ShowHide ( 'Douguoqiang'), "" Douguoqiang</td>
"Per
"Tr>
"Td formal" submenu "filled="f"" Douguoqiang "Historic Significance of the Transitional Budget" display : none ""
"Width= table" 226 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td width=" 224 "formal" files "and" <a style='mso-footnote-id:ftn1' "http : //211.81.22.61/homepage/douguoq/zddh.html "target=" _blank "" Homepage</a></td>
"Per
"Tr>
"Td formal" files "and" Secondpage</td>
"Per
"/table></td>
"Per
"Tr>
"Td height=" 19 "formal" emenu "onMouseUp=" ShowHide ( '51windows'), "" 51windows</td>
"Per
"Tr>
"Td formal" submenu "filled="f"" 51windows "Historic Significance of the Transitional Budget" display : none ""
"Width= table" 200 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td height=" 18 "formal" emenu "onMouseUp=" ShowHide ( 'Contents2'), "" Contents2</td>
"Per
"Tr>
"Td formal" submenu "filled="f"" Contents2 "Historic Significance of the Transitional Budget" display : none ""
"Width= table" 200 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td formal" files "and" <a style='mso-footnote-id:ftn1' "http://www.buleidea.com" target= "_blank" "Javascirpt</a></td>
"Per
"Tr>
"Td formal" files "and" <a style='mso-footnote-id:ftn1' "http://www.tute.edu.cn" target= "_blank" "Flash</a></td>
"Per
"Tr>
"Td formal" files "and" Photoshop</td>
"Per
"/table></td>
"Per
"/table></td>
"Per
"ShapeID="_x0000_i1025" DrawAspect="Content" ObjectID="_1127825915"> </o:OLEObject>
"/body>
"/html>
[/html]
4, Xie.
LeXRus grateful for the original procedure.
Thank panliu888 had help.
Thank you for reading. |
Which illustrated editorial about me, I edited bad. |
Thank you read my tutor :)
1. Mozilla browser does not support such event.srcElement, you wrote parameters can be heard
2. Acquiescence on the state of closure, the final results were already there - demonstration |
LeXRus said in a message
Do you mean that it is not used id ah, then, and I have no good alternative to the use of that phrase.
Can you detail-point? |
[html]<script>
Function sh (obj) (
Alert (obj.style.display)
}
"/script>
"Onclick= a" sh (this) "Historic Significance of the Transitional Budget" display:inline "" aspects of
"Onclick= a" sh (this) "Historic Significance of the Transitional Budget" display:block "" 2</a>[/html] |
Feasibility feeling somewhat difficult.
So I turned around and consider carefully.
Onmouseup onclick event and the initial conflict. |
LeXRus that is not their fault, in a ~! !
[code]
"Html>
"Head are
"Title> tree menu" /title>
"Script language=" JavaScript ""
4003rd Example : obj = findObj ( "image1");
Function findObj (theObj, theDoc)
{
Var p, i, foundObj;
If (!theDoc) theDoc = document;
If ((p = theObj.indexOf ( "? "))", Named parent.frames.length 0)
{
Parent.frames[theObj.substring theDoc = (p + 1) ].document;
TheObj.substring theObj = (0, p);
}
If (! (FoundObj = theDoc[theObj]) & theDoc.all) foundObj = theDoc.all[theObj];
For (i i=0; !foundObj, named "theDoc.forms.length; i++)
FoundObj = theDoc.forms[i][theObj];
For (i i=0; !foundObj, named theDoc.layers, named "theDoc.layers.length; i++)
FoundObj = findObj (theObj, theDoc.layers[i].document);
If (!foundObj, named document.getElementById) foundObj = document.getElementById (theObj);
Return foundObj;
}[color=Red]
Function ShowHide (ObjectId, Constructing)
{
If (findObj (ObjectId). Style.display== 'none') (
FindObj (ObjectId). Style.display= '';
Obj.style.backgroundImage= 'government payments are capped (e.gif)' ;}
Else
{findObj (ObjectId). Style.display= 'none';
Obj.style.backgroundImage= 'government payments are capped (c.gif)' ;}
}[/color]
"/script>
"Style type=" text/css ""
<!--
. Emenu --
Background-image : government payments are capped (c.gif);
Background-repeat : no-repeat;
Padding-left : 40px;
Cursor : hand;
}
. Submenu --
Padding-left : 24px;
}
. Files --
Background-image : government payments are capped (ie.gif);
Background-repeat : no-repeat;
Cursor : hand;
Padding-left : 18px;
}
-->
"/style>
"/head>
"Body>
Tree Menu
"Hr>
"Width= table" 200 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td height=" 19 "formal" emenu "[color=Red]onMouseUp=" ShowHide ( 'Buleidea' this) "[/color]>Buleidea</td>
"Per
"Tr>
"Td formal" submenu "filled="f"" Buleidea "Historic Significance of the Transitional Budget" display : none ""
"Width= table" 200 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td height=" 18 "formal" emenu "[color=Red]onMouseUp=" ShowHide ( 'Contents' this) "[/color]>Contents</td>
"Per
"Tr>
"Td formal" submenu "filled="f"" Contents "Historic Significance of the Transitional Budget" display : none "and" the "table width=" 200 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td formal" files "and" <a style='mso-footnote-id:ftn1' "http://www.buleidea.com" target= "_blank" "Javascirpt</a></td>
"Per
"Tr>
"Td formal" files "and" <a style='mso-footnote-id:ftn1' "http://www.tute.edu.cn" target= "_blank" "Flash</a></td>
"Per
"Tr>
"Td formal" files "and" Photoshop</td>
"Per
"/table></td>
"Per
"/table></td>
"Per
"Tr>
"Td height=" 18 "formal" emenu "[color=Red]onMouseUp=" ShowHide ( 'Douguoqiang' this) "[/color]>Douguoqiang</td>
"Per
"Tr>
"Td formal" submenu "filled="f"" Douguoqiang "Historic Significance of the Transitional Budget" display : none ""
"Width= table" 226 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td width=" 224 "formal" files "and" <a style='mso-footnote-id:ftn1' "http : //211.81.22.61/homepage/douguoq/zddh.html "target=" _blank "" Homepage</a></td>
"Per
"Tr>
"Td formal" files "and" Secondpage</td>
"Per
"/table></td>
"Per
"Tr>
"Td height=" 19 "formal" emenu "[color=Red]onMouseUp=" ShowHide ( '51windows' this) "[/color]>51windows</td>
"Per
"Tr>
"Td formal" submenu "filled="f"" 51windows "Historic Significance of the Transitional Budget" display : none ""
"Width= table" 200 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td height=" 18 "formal" emenu "[color=Red] onMouseUp=" ShowHide ( 'Contents2' this) "[/color]>Contents2</td>
"Per
"Tr>
"Td formal" submenu "filled="f"" Contents2 "Historic Significance of the Transitional Budget" display : none ""
"Width= table" 200 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td formal" files "and" <a style='mso-footnote-id:ftn1' "http://www.buleidea.com" target= "_blank" "Javascirpt</a></td>
"Per
"Tr>
"Td formal" files "and" <a style='mso-footnote-id:ftn1' "http://www.tute.edu.cn" target= "_blank" "Flash</a></td>
"Per
"Tr>
"Td formal" files "and" Photoshop</td>
"Per
"/table></td>
"Per
"/table></td>
"Per
"ShapeID="_x0000_i1025" DrawAspect="Content" ObjectID="_1127825915"> </o:OLEObject>
"/body>
"/html>
[html]
"Html>
"Head are
"Title> tree menu" /title>
"Script language=" JavaScript ""
4003rd Example : obj = findObj ( "image1");
Function findObj (theObj, theDoc)
{
Var p, i, foundObj;
If (!theDoc) theDoc = document;
If ((p = theObj.indexOf ( "? "))", Named parent.frames.length 0)
{
Parent.frames[theObj.substring theDoc = (p + 1) ].document;
TheObj.substring theObj = (0, p);
}
If (! (FoundObj = theDoc[theObj]) & theDoc.all) foundObj = theDoc.all[theObj];
For (i i=0; !foundObj, named "theDoc.forms.length; i++)
FoundObj = theDoc.forms[i][theObj];
For (i i=0; !foundObj, named theDoc.layers, named "theDoc.layers.length; i++)
FoundObj = findObj (theObj, theDoc.layers[i].document);
If (!foundObj, named document.getElementById) foundObj = document.getElementById (theObj);
Return foundObj;
}
Function ShowHide (ObjectId, Constructing)
{
If (findObj (ObjectId). Style.display== 'none') (
FindObj (ObjectId). Style.display= '';
Obj.style.backgroundImage= 'government payments are capped (http://lexrus.com/Tutor/FileMenu/e.gif)' ;}
Else
{findObj (ObjectId). Style.display= 'none';
Obj.style.backgroundImage= 'government payments are capped (http://lexrus.com/Tutor/FileMenu/c.gif)' ;}
}
"/script>
"Style type=" text/css ""
<!--
. Emenu --
Background-image : government payments are capped (http://lexrus.com/Tutor/FileMenu/c.gif);
Background-repeat : no-repeat;
Padding-left : 40px;
Cursor : hand;
}
. Submenu --
Padding-left : 24px;
}
. Files --
Background-image : government payments are capped (http://lexrus.com/Tutor/FileMenu/ie.gif);
Background-repeat : no-repeat;
Cursor : hand;
Padding-left : 18px;
}
-->
"/style>
"/head>
"Body>
Tree Menu
"Hr>
"Width= table" 200 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td height=" 19 "formal" emenu "onMouseUp=" ShowHide ( 'Buleidea' this), "" Buleidea</td>
"Per
"Tr>
"Td formal" submenu "filled="f"" Buleidea "Historic Significance of the Transitional Budget" display : none "and" the "table width=" 200 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td height=" 18 "formal" emenu "onMouseUp=" ShowHide ( 'Contents', this), "" Contents</td>
"Per
"Tr>
"Td formal" submenu "filled="f"" Contents "Historic Significance of the Transitional Budget" display : none "and" the "table width=" 200 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td formal" files "and" <a style='mso-footnote-id:ftn1' "http://www.buleidea.com" target= "_blank" "Javascirpt</a></td>
"Per
"Tr>
"Td formal" files "and" <a style='mso-footnote-id:ftn1' "http://www.tute.edu.cn" target= "_blank" "Flash</a></td>
"Per
"Tr>
"Td formal" files "and" Photoshop</td>
"Per
"/table></td>
"Per
"/table></td>
"Per
"Tr>
"Td height=" 18 "formal" emenu "onMouseUp=" ShowHide ( 'Douguoqiang' this), "" Douguoqiang</td>
"Per
"Tr>
"Td formal" submenu "filled="f"" Douguoqiang "Historic Significance of the Transitional Budget" display : none ""
"Width= table" 226 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td width=" 224 "formal" files "and" <a style='mso-footnote-id:ftn1' "http : //211.81.22.61/homepage/douguoq/zddh.html "target=" _blank "" Homepage</a></td>
"Per
"Tr>
"Td formal" files "and" Secondpage</td>
"Per
"/table></td>
"Per
"Tr>
"Td height=" 19 "formal" emenu "onMouseUp=" ShowHide ( '51windows' this), "" 51windows</td>
"Per
"Tr>
"Td formal" submenu "filled="f"" 51windows "Historic Significance of the Transitional Budget" display : none ""
"Width= table" 200 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td height=" 18 "formal" emenu "onMouseUp=" ShowHide ( 'Contents2' this), "" Contents2</td>
"Per
"Tr>
"Td formal" submenu "filled="f"" Contents2 "Historic Significance of the Transitional Budget" display : none ""
"Width= table" 200 "cellpadding=" 0 "cellspacing" 0 ""
"Tr>
"Td formal" files "and" <a style='mso-footnote-id:ftn1' "http://www.buleidea.com" target= "_blank" "Javascirpt</a></td>
"Per
"Tr>
"Td formal" files "and" <a style='mso-footnote-id:ftn1' "http://www.tute.edu.cn" target= "_blank" "Flash</a></td>
"Per
"Tr>
"Td formal" files "and" Photoshop</td>
"Per
"/table></td>
"Per
"/table></td>
"Per
"ShapeID="_x0000_i1025" DrawAspect="Content" ObjectID="_1127825915"> </o:OLEObject>
"/body>
"/html>
[/html]
[/code]
|
Click to project how upstairs when there icon? No one under that level also. |
Well it now, just did not have a good ~! |
|