ready to roll?
Kod:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript"> function loadscript() { navRoot = document.getElementById("menu"); for (i=0; i<navRoot.childNodes.length; i++) { node = navRoot.childNodes[i]; if (node.nodeName=="LI") { node.onmouseover=function() { this.className="over"; } node.onmouseout=function() { this.className=this.className.replace("over", ""); } for (j=0; j<node.childNodes.length; j++) { if(node.childNodes[j].nodeName=='UL') { t = (node.childNodes[j].childNodes.length*13)-15; // proba oszacowania przesuniecia submenu node.childNodes[j].style.top= '-'+t+'px'; } } } } } window.onload=loadscript; </script> <style> ul { margin: 0; padding: 0; list-style-type: none; } div#menubar { padding: 230px 0 30px 0; } div#menubar ul { width: 100%; } div#menubar ul li { position: relative; float: left; width: 113px; padding: 0 10px 0 10px; } div#menubar ul li ul { position: absolute; display: none; left: 0; } div#menubar ul li a { display: block; background: #3C3634; text-decoration: none; color: #ED8A9E; font-style: italic; border: 1px solid #fff; } /* Fix IE. Hide from IE Mac \*/ * html div#menubar ul li { float: left; height: 1%; } * html div#menubar ul li a { height: 1%; } /* End */ div#menubar ul li a:hover { color: #fff; background: #ED8A9E; } div#menubar li ul li a { padding: 2px 5px; } div#menubar li:hover ul, div#menubar li.over ul { display: block; }</style> </head> <body> <div id='menubar'> <ul id='menu'> <ul> </ul> </li> <ul> </ul> </li> </ul> </div> </body> </html>
pozdrawiam i prosze o pomoc!