Move the mouse to trigger the move of the hierarchical menu layer menu moveMenu _ navigation menu-js tutorial

Source: Internet
Author: User
Move the menu, layer menu, and mouse over the menu, and the menu will move. The floating menu, such as a TAB-style menu, uses an image, you can download the modified small image following the Code. If you need a friend, you can refer to the menu that will be moved, layer menu, and mouse over the menu. Then the menu will move and move up the menu, for a TAB-style menu, you can use an image to download the modified small image following the code.

<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN"> <HTML> <HEAD> <TITLE> move menu, layer menu moveMenu </TITLE> <META content = "text/html; charset = gb2312" http-equiv = Content-Type> <STYLE type = text/css>. alpha {FILTER: Alpha (Opacity = 80 )}. td1 {FONT-SIZE: 12px }. td2 {BACKGROUND-COLOR: # ccffff; CURSOR: hand; FONT-SIZE: 12px }. maskl {OVERFLOW: hidden }. cardtitle {BORDER-BOTTOM: black 0px solid; BORDER- LEFT: black 0px solid; BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; CURSOR: default; FONT-SIZE: 12px; TEXT-INDENT: 4pt }. cardbottom {BACKGROUND-COLOR: #99 ccff; BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-RIGHT: black 1px solid; BORDER-TOP: black 0px solid; FILTER: Alpha (Opacity = 90) }</STYLE> <SCRIPT language = Jscript> // we recommend that you use IE5.0 or above to apply this code. //**************** * ********************************** // Use an array to store multiple timeouts. tBack = new Array (5); tOut = new Array (5); // activate the current tab. function menuOut (whichMenu) {var curMenu = eval ("menu" + whichMenu); curMenu. runtimeStyle. zIndex = 6; clearTimeout (tBack [whichMenu]); moveOut (whichMenu);} // restore the initial state. function menuBack (whichMenu) {var curMenu = eval ("menu" + whichMenu); curMenu. runtimeStyle. zIndex = curMenu. style. zIndex; clearTimeout (tOu T [whichMenu]); moveBack (whichMenu);} // Move the current tab function moveOut (curNum) {var curMenu = eval ("menu" + curNum); if (curMenu. style. posLeft> 0) {curMenu. style. posLeft-= 2; tOut [curNum] = setTimeout ("moveOut ('" + curNum + "')", 1) ;}/// move back to the tab. function moveBack (curNum) {var curMenu = eval ("menu" + curNum); if (curMenu. style. posLeft <30) {curMenu. style. posLeft + = 2; tBack [curNum] = setTimeout ("moveBack ('" + curNum + "')", 1 );}} // Changes the table unit pattern when the mouse moves. Function swapClass () {var o = event. srcElement; if (o. className = "td1") o. className = "td2" else if (o. className = "td2") o. className = "td1";} document. onmouseover = swapClass; document. onmouseout = swapClass; SCRIPT <META content = "MSHTML 5.00.2920.0" name = GENERATOR> </HEAD> <BODY bgColor = # ffffff leftMargin = 0 text = #000000 topMargin = 0 marginheight = "0" marginwidth = "0"> <TABLE align = center border = 0 height = "100%" width = 75> <TBODY> <TR> <TD class = td1> Option 1 </TD> </TR> <TD class = td1> Option 2 </TD> </TR> <TD class = td1> Option 3 </TD> </TR> <TD class = td1> Option 4 </TD> </TR> </TBODY> </TABLE> <TABLE border = 0 cellPadding = 0 cellSpacing = 0 width = 100> <TBODY> <TR> <TD height = 18 width = 14> </TD> <TD bgColor = #99 ccff class = cardtitle height = 14 width = 86> Tab 1 </TD> </TR> </TBODY> </TABLE> <TABLE align = center border = 0 height = "100%" width = 75> <TBODY> <TR> <TD class = td1> Option 1 </TD> </TR> <TD class = td1> Option 2 </TD> </TR> <TD class = td1> Option 3 </TD> </TR> <TD class = td1> Option iv. </TD> </TR> </TBODY> </TABLE> <TABLE border = 0 cellPadding = 0 cellSpacing = 0 width = 100> <TBODY> <TR> <TD height = 18 width = 14> </TD> <TD bgColor = #99 ccff class = cardtitle height = 14 width = 86> Tab 2 </TD> </TR> </TBODY> </TABLE> <TABLE align = center border = 0 height = "100%" width = 75> <TBODY> <TR> <TD class = td1> Option 1 </TD> </TR> <TD class = td1> Option 2 </TD> </TR> <TR> <TD class = td1> Option 3 </TD> </TR> <TD class = td1> Option 4 </TD> </TR> <TD> </TR> </TBODY> </TABLE> <TABLE border = 0 cellPadding = 0 cellSpacing = 0 width = 100> <TBODY> <TR> <TD height = 18 width = 14> </TD> <TD bgColor = #99 ccff class = cardtitle height = 14 width = 86> tab 3 </TD> </TR> </TBODY> </TABLE> <TABLE align = center border = 0 height = "100%" width = 75> <TBODY> <TR> <TD class = td1> Option 1 </ TD> </TR> <TD class = td1> Option 2 </TD> </TR> <TD class = td1> Option 3 </TD> </TR> <TD class = td1> Option 4 </TD> </TR> </TBODY> </TABLE> <TABLE border = 0 cellPadding = 0 cellSpacing = 0 width = 100> <TBODY> <TR> <TD height = 18 width = 14> </TD> <TD bgColor = #99 ccff class = cardtitle height = 14 width = 86> tab 4 </TD> </TR> </TBODY> </TABLE> <TABLE align = center border = 0 height = "100%" width = 75> <TBODY> <TR> <TD class = td1> Option 1 </TD> </TR> <TD class = td1> Option 2 </TD> </TR> <TD class = td1> Option 3 </TD> </TR> <TD class = td1> option 4 </TD> </TR> </TBODY> </TABLE> <TABLE border = 0 cellPadding = 0 cellSpacing = 0 width = 100> <TBODY> <TR> <TD height = 18 width = 14> </TD> <TD bgColor = #99 ccff class = cardtitle height = 14 width = 86> tab 5 </TD> </TR> </TBODY> </TABLE> </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.