| Личные сообщения() · Новые сообщения · Участники · Правила форума · Поиск · Предложения по дизайну |
|
| Форум » Скрипты для uCoz » Меню для сайта » Меню вытаскивается мышью |
| Меню вытаскивается мышью |
Пример тут-> http://www.scriipt.ru/LeftMenue.html
Code <!-- HEAD START HERE --> <style> <!-- #slidemenubar, #slidemenubar2{ cursor:hand; position:absolute; left:-152px; width:160px; top:170px; border:1.5px solid green; background-color:lightyellow; layer-background-color:lightyellow; font:bold 12px Verdana; line-height:20px; } --> </style> <!-- HEAD END HERE --> </head> <body background="http://web-script.narod.ru/background1.gif" text=black> <br> <center> <br> <h2>Вытащите меню, оно слева!</h2> <!-- BODY START HERE --> <script language="JavaScript1.2"> /* Sliding Menu Bar Script 3- © Dynamic Drive (www.dynamicdrive.com) For full source code, installation instructions, and TOS Visit http://dynamicdrive.com */ var ns4=document.layers?1:0 var ie4=document.all?1:0 var ns6=document.getElementById&&!document.all?1:0 if (ie4||ns6) document.write('<div id="slidemenubar2" style="left:-150">') else document.write('<layer id="slidemenubar">') var sitems=new Array() var sitemlinks=new Array() ///////////Edit below///////////////////////////////// //extend or shorten this list sitems[0]="Omen" sitems[1]="Web-script" sitems[2]="Pupsik" sitems[3]="Microsoft" sitems[4]="Yandex" sitems[5]="Rambler" sitems[6]="Google" sitems[7]="Yahoo" //These are the links pertaining to the above text. sitemlinks[0]="http://omen.ru" sitemlinks[1]="http://web-script.narod.ru" sitemlinks[2]="http://pupsik.ru" sitemlinks[3]="http://microsoft.com" sitemlinks[4]="http://yandex.ru" sitemlinks[5]="http://rambler.ru" sitemlinks[6]="http://google.com" sitemlinks[7]="http://Yahoo.com" //If you want the links to load in another frame/window, specify name of target (ie: target="_new") var target="" ///////////////////////////////////////////////////////// for (i=0;i<=sitems.length-1;i++) document.write('<a href='+sitemlinks[i]+' target="'+target+'">'+sitems[i]+'</a><br>') function regenerate(){ window.location.reload() } function regenerate2(){ if (ns4) setTimeout("window.onresize=regenerate",400) } window.onload=regenerate2 if (ie4||ns6){ document.write('</div>') themenu=(ns6)? document.getElementById("slidemenubar2").style : document.all.slidemenubar2.style rightboundary=0 leftboundary=-150 } else{ document.write('</layer>') themenu=document.layers.slidemenubar rightboundary=150 leftboundary=10 } var dragapproved=false var x1,x2 if (ns4) themenu.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP) function move(e){ if (ie4&&event.button==1&&dragapproved){ if(temp1+event.clientX-x1>leftboundary) themenu.pixelLeft=Math.min(rightboundary,temp1+event.clientX-x1) else themenu.pix elLeft=Math.max(leftboundary,temp1+event.clientX-x1) } else if (ns6&&dragapproved){ if(parseInt(themenu.left)+e.clientX-x2>leftboundary) themenu.left=Math.min(rightboundary+2,temp1+e.clientX-x2) else theme nu.left=Math.max(leftboundary-2,temp1+e.clientX-x2) } else if (ns4){ if(themenu.left+e.x-x2>leftboundary) themenu.left=Math.min(rightboundary+2,themenu.left+e.x-x2) else themenu.left=Math.max(leftbo undary-2,themenu.left+e.x-x2) } } function drags(e){ if (ie4){ dragapproved=true temp1=themenu.pixelLeft x1=event.clientX document.onmousemove=move } else if (ns6){ dragapproved=true temp1=parseInt(themenu.left) x2=e.clientX document.getElementById("slidemenubar2").onmousemove=move } else{ t hemenu.captureEvents(Event.MOUSEMOVE) x2=e.x } } function stopit(){ if (ie4||ns6){ dragapproved=false } if (ns4) themenu.releaseEvents(Event.MOUSEMOVE) } if (ie4){ document.all.slidemenubar2.onmousedown=drags document.all.slidemenubar2.onmouseup=new Function("dragapproved=false") document.onselectstart=new Function("return false") } else if (ns6){ document.getElementById("slidemenubar2").onmousedown=drags document.getElementById("slidemenubar2").onmouseup=new Function("dragapproved=false") } else if (ns4){ themenu.onmousedown=drags themenu.onmousemove=move themenu.onmouseup=stopit } </script> <!-- BODY END HERE --> |
| |||
| |||
