Using the mouse to hold the link menu

Source: Internet
Author: User
Tip: You can modify some of the code before running

<ptml> <pead> <meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "> <meta name=" generator "content=" Microsoft FrontPage 5.0 "> <meta name=" ProgId "content=" FrontPage.Editor.Document "> <title> with Mouse Support link menu </title> </pead> <body> <style> <!- -#slidemenubar, #slidemenubar2 {cursor:hand; position:absolute; left:-155px; width:160px; top:170px; border:1.5px Solid Green; Background-color:lightyellow; Layer-background-color:lightyellow; Font:bold 12px Verdana; line-height:20px; --> </style> <layer id= "Slidemenubar" > <script language= "JavaScript1.2" > if (document.all) document.write (' <div id= ' slidemenubar2 ' > ') var sitems=new array () var sitemlinks=new array () sitems[0]= "My Links"; sitemlinks[0]= "#" sitems[1]= "My Link"; sitemlinks[1]= "#" sitems[2]= "My Link"; sitemlinks[2]= "#" sitems[3]= "My Link"; sitemlinks[3]= "#" sitems[4]= "My Link"; sitemlinks[4]= "#" for (i=0;i<=sitems.length-1;i++) document.write (' +sitems[i]+ ' <br> ') </script> </layer> <script language= "JavaScript1.2" > function Regenerate () {window.location.reload ()} function Regenerate2 () {if (document.layers) settimeout ("window.onresize= Regenerate ","} window.onload=regenerate2 if (document.all) {document.write (' </div> ') themenu= Document.all.slidemenubar2.style rightboundary=0 leftboundary=-150} else{Themenu=document.layers.slidemenubar rightboundary=150 leftboundary=10} var dragapproved=false var x1,x2 if (document.layers) themenu.captureevents ( Event.mousedown | Event.mouseup) function Move (e) {if (document.all&&event.button==1&&dragapproved) {if (temp1+) event.clientx-x1>leftboundary) themenu.pixelleft=math.min (rightboundary,temp1+event.clientx-x1) Else Themenu.pixelleft=math.max (LEFTBOUNDARY,TEMP1+EVENT.CLIENTX-X1)} else if (document.layers) {if (themenu.left+e.x-x2 >leftboundary) themenu.left=math.min (rightboundary+2,themenu.left+e.x-x2) Else Themenu.left=math.max(LEFTBOUNDARY-2,THEMENU.LEFT+E.X-X2)} } function drags (e) {if (document.all) {dragapproved=true temp1=themenu.pixelleft X1=event.clientx Document.onmousemove=move} else{themenu.captureevents (Event.mousemove) x2=e.x}} function StoPit () {if (document.all) {Dragapproved=false} if (document.layers) themenu.releaseevents (Event.mousemove)} if (document.all) { Document.all.slidemenubar2.onmousedown=drags document.all.slidemenubar2.onmouseup=new Function ("dragapproved= False ") Document.onselectstart=new Function (" Return false ")} else if (document.layers) {Themenu.onmousedown=drags Themenu.onmousemove=move Themenu.onmouseup=stopit} </script> </body> </ptml>
Tip: You can modify some of the 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.