Right-click the XP style menu implemented by js

Source: Internet
Author: User

Instructions for use:
Create a menu object before using it.
Var obj = new MouseMenu ("obj ");
Note that obj must be the same as the obj of MouseMenu ("obj ").
If obj is created, the following method is used to start obj. length = 0.
Method:
1. addMenu (express [, icon] [, url] [, target] [, title]);
Function: Insert a menu and return a menu object with the same function as the obj mentioned above.
Obj [obj. length] Then obj. length will be + 1
Note:
Express required, String, text displayed on the inserted menu
Optional; INTEGER (> 0). If you do not need an icon, enter ""
Url optional, String, path
Target (Optional). The string is the target.
Optional title. The string is title.
2. addLink (express, [, icon] [, url] [, target] [, title])
Function: Insert a connection and the obj. length value will be greater than 1.
Description
Express required, String, text displayed on the inserted menu
Optional; INTEGER (> 0). If you do not need an icon, enter ""
Url required, String, path
Target (Optional). The string is the target.
Optional title. The string is title.
3. addHR ()
Function: Insert a split line.
Note:
It does not belong to the link and menu objects. Therefore, obj. length remains unchanged during use.
For example:
Var MM = new MouseMenu ("MM ")
MM. addLink ("Connect", "", "http://hello.com ")
MM. addHR ()
MM. addMenu ("menu ")
// The following is MM [1] instead of MM [2] Because MM. addHR () MM. length will not increase
MM [1]. addLink ("connection", "", "http://hello.com ")
Okay. Should I use it if I say so much?
Someone suddenly asked: "where to insert a connection ......"
...... Hmm ~ This ^_^! See the above ~~~~
Additional: other data in the code
// --------------- Data -----------------//
Var IconList = new Array (); // icon image set, subscript starts from 1
IconList [1] = new Image ();
IconList [1]. src = "icon/sub.gif ";
// ----------------------------- Sound switch ------ sound switch ------------------//
Var mouseCanSound = true;
Var menuSpeed = 50; // ---------- menu display speed ------------//
Var alphaStep = 30; // ---------- Alpaha variation degree -----------//
<Html> <pead> <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312 "> <title> webpage effect | www.jb51.net | --- Right-click the xp style menu </title> <STYLE>. menutable {BACKGROUND-COLOR: # ffffff; BORDER-BOTTOM: #307ce8 1px solid; BORDER-LEFT: #307ce8 5px solid; BORDER-RIGHT: #307ce8 1px solid; BORDER-TOP: #94bcf3 1px solid; FONT-SIZE: 12px; POSITION: absolute; Z-INDEX: 100 }. menutrin {BACKGROUND-COLOR: #1a71e6; COLO R: # ffffff; CURSOR: hand }. menutrout {COLOR: #000000; CURSOR: hand }. menutd0 {HEIGHT: 25px; TEXT-ALIGN: center; WIDTH: 28px; change the menu HEIGHT ---> :}. menutd1 {FONT-FAMILY: Webdings; TEXT-ALIGN: right; WIDTH: 46px }. linktd1 {WIDTH: 46px }. menutd2 {WIDTH: 4px }. menuhr {BORDER-BOTTOM: #307ce8 1px inset; BORDER-LEFT: #307ce8 1px inset; BORDER-RIGHT: #307ce8 1px inset; BORDER-TOP: #307ce8 1px inse T} </STYLE> <BGSOUND id = theBS loop = 0 src = ""> </HEAD> <BODY bgColor = # eaf5fd style = "FONT-SIZE: 10pt "> <P> sound ...... You can close it! Set mouseCanSound to false. </P> </BODY> </HTML>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]

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.