Code encapsulated
Thank you for your support!
For more information, see the menu of some Flash sites,
I used javascript to simulate one, and the effect was Cool.
Write a simple instruction:
Step 1: materialized X-Menu class
Usage:
Var <entity variable>. new CoolMenuControl ()
Step 2: Create a menu project ---
Usage:
<Entity variable>. insertmenu (type, Html code, link URL, target)
Type: 0 indicates the menu title, 1 indicates the tree menu sub-project, and 2 indicates the horizontal Menu Sub-project.
Html code: Html code displayed on the menu
Link URL: Needless to say, URL or Javascript script
Target: empty by default, which is not opened on this page; "_ blank" indicates opening on a new page
For example:
CoolMenu2.insertmenu ("2", " Sina", "http://www.sina.com.cn/", "_ blank ")
Step 3: Create a menu ---
Usage:
<Object variable>. init (object variable name, border color, background color, sliding speed, and translucent background)
'Object variable name' must be the same as <object variable>
If the background color = "transparent" is completely transparent
For example:
CoolMenu1.init ("CoolMenu1", "#002000", "#38 FFff", 0.1, 15)
<Head> <meta http-equiv = "Content-Language" content = "zh-cn"> <style>. B {color = #000066; cursor: hand }. menu {font-family: Arial; cursor: Default; font-size: 12px; border: 1px #000000 solid; border-collapse: collapse; filter: progid: DXImageTransform. microsoft. gradient (gradienttype = 0, startcolorstr = # ffffff, endcolorstr = # dddddddd) progid: DXImageTransform. microsoft. shadow (direction = 135, color = # cccccc, strength = 3 );}. ht {font-weight: bold }</style> </pead> <body> </body>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]