Простейшее текстовое меню навигации напоминающее по структуре меню Пуск в Windows (выпадающее динамическое меню)
<style;> .spanstyle { position:absolute; visibility:hidden; } a.menu { color: #006000; text-decoration: none; font-size: 11pt; font-weight: bold} a:hover {color:#ff0000; } </style> <script; language="JavaScript"> <!-- var subMenu=-1; var menunames=new Array("Скрипты","Апплеты","Ссылки","Примеры");//Массив названий элементов первого уровня меню var menuSubNames=new Array();//Массив названий подменю var menuSubLinks=new Array();//Массив ссылок подменю menuSubNames[0]= new Array("Скрипт1","Скрипт2","Скрипт3","Скрипт4"); menuSubNames[1]= new Array("Апплет1","Апплет2","Апплет3","Апплет4","Апплет5","Апплет6"); menuSubNames[2]= new Array("Ссылка1","Ссылка2","Ссылка3","Ссылка4","Ссылка5"); menuSubNames[3]= new Array("Пример1","Пример1","Пример1"); menuSubLinks[0]= new Array("/javascript/examples/1.html", "/javascript/examples/2.html", "/javascript/examples/3.html", "/javascript/examples/4.html"); menuSubLinks[1]= new Array("/javascript/examples/1.html", "/javascript/examples/2.html", "/javascript/examples/3.html", "/javascript/examples/4.html", "/javascript/examples/5.html", "/javascript/examples/6.html"); menuSubLinks[2]= new Array("http://www.javaportal.rlu/javascript/examples/1.html", "/javascript/examples/2.htm", "/javascript/examples/3.html", "/javascript/examples/4.html", "/javascript/examples/5.html"); menuSubLinks[3]= new Array("/javascript/examples/1.html", "/javascript/examples/2.htm", "/javascript/examples/3.html"); for(i=0;i"+menunames[i]+"
"); document.write(""); document.write(""); document.write(""); } function newSubMenu(indexSubMenu,e) { var x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX; var y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY; if(subMenu!=-1) { var thisspan; thisspan = eval("span"+(subMenu)+".style"); thisspan.visibility = 'hidden' thisspan.visibility = 'hidden' } subMenu=indexSubMenu; thisspan = eval("span"+(subMenu)+".style"); thisspan.visibility = 'visible' thisspan.posLeft=x; thisspan.posTop=y; } function deleteSubMenu(indexSubMenu) { var thisspan = eval("span"+(indexSubMenu)+".style"); thisspan.visibility = 'hidden' thisspan.visibility = 'hidden' subMenu=-1; } function docMM(e) { var x = document.body.scrollLeft+event.clientX; var y = document.body.scrollTop+event.clientY; if(subMenu!=-1) { var x1=0; var x2=0; var y1=0; var y2=0; var thisspan = eval("span"+(subMenu)+".style"); x1= thisspan.posLeft; y1= thisspan.posTop; x2 =x1+ thisspan.offsetWidth; x2=x1+70; y2= y1+thisspan.offsetHeight; y2=y1+100; if((x
"); for(j=0;j "+menuSubNames[i][j]+"
") } document.write("x2)||(y y2))deleteSubMenu(subMenu) } } document.onmousedown=docMM; //--> </script>