Js left stretch navigation menu

Source: Internet
Author: User
Tip: you can modify some code before running

Js left stretch navigation menu<SCRIPT language=JavaScript>Function move (x, y ){<!--对象移动x,y-->If (document. all ){<!--对于ie浏览器-->Object1.style. pixelLeft + = x;<!--左边界移动x-->Object1.style. pixelTop + = y ;}<!--上边界移动y-->}; Function position (){<!--对象位置移动-->Document. object1.left ++ =-132;<!--左边界向左移动-->Document. object1.top + = 0;<!--上边界不变-->Document. object1.visibility = "show"<!--设置为可视-->}; Function makeStatic () {if (document. all) {object1.style. pixelTop = document. body. scrollTop + 20}<!--对于ie浏览器,设置带显示对象的上边界-->}</sCRIPT><STYLE type=text/css>. Hl {BACKGROUND-COLOR: highlight; COLOR: white; CURSOR: hand}</sTYLE></hEAD><BODY leftMargin=0 topMargin=0><CENTER> <LAYER class=NS onmouseout="move(-132, 0)" onmouseover="move(132, 0)" left="0" bgcolor="black" name="object1" top="20" visibility="hide"> <SCRIPT language=JavaScript>If (document. all) document. write ('<DIV ID="object1" >')</sCRIPT> </lAYER> <TABLE bgColor=#000000 border=0 cellPadding=2 cellSpacing=1 onmouseout="move(-132, 0)" onmouseover=move(132,0) width=150> <TBODY> <TR> <TD bgColor=#FFFFFF><B><FONT size=3 face="隶书">Food order</fONT></b></tD> <TD align=middle bgColor=#C0C0C0 rowSpan=100 width=12> <SCRIPT language=JavaScript>If (document. all) document. write ('<p align="center"><font size="3" color="#FFFFFF" face="Arial Black">Display<br>Display<br>Food<br>Single</font></p>')</sCRIPT> </tD></tR> <SCRIPT language=JavaScript>MakeStatic ();<!--调用makestatic函数-->Var sitems = new Array ();<!--存放链接的内容-->Var sitemlinks = new Array ();<!--存放链接的地址-->Sitems [0] = "TOM ";<!--第一条链接的内容-->Sitems [1] = "Sohu ";<!--第二条链接的内容-->Sitems [2] = "NetEase ";<!--第三条链接的内容-->Sitemlinks [0] = "http://www.111cn.net ";<!--第一条链接的地址-->Sitemlinks [1] = "http://www.111cn.net /";<!--第二条链接的地址-->Sitemlinks [2] = "http://www.111cn.net /";<!--第三条链接的地址-->For (I = 0; I <= sitems. length-1; I ++)<!--依次对每一个菜单进行处理--><!--对于ie浏览器,设置每个菜单的背景、链接、鼠标移动到上边的响应函数,以及鼠标离开的函数-->If (document. all) {document. write ('<TR><TD bgcolor=white onclick="location=''+sitemlinks[i]+''" onmouseover="className='hl'" onmouseout="className='n'"><FONT SIZE=2>'+ Sitems [I] +'</fONT></tD></tR>')} Function hl (n) {n. className = 'hl '}<!--将当前菜单的格式设置为hl-->Function n (h) {h. className = 'n '}<!--将当前菜单的格式设置为n--> </sCRIPT> </tBODY></tABLE> <!--本例程实现了自动能够隐藏菜单的效果--><!--菜单效果变化的实现方法--><!--对不同浏览器的支持--><!--对鼠标移动的函数响应--><!--统一格式的生成方法-->
Tip: you can modify some code before running

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.