![]() |
![]() |
![]()
Post
#1
|
|
![]() Grupa: Zarejestrowani Postów: 40 Pomógł: 1 Dołączył: 29.12.2003 Skąd: Szczecin Ostrzeżenie: (0%) ![]() ![]() |
Kod $ = function (id) { return document.getElementById(id); } window.onload = function () { getMenu(); } getMenu = function (subMenu) { if (!subMenu) { var subMenu = ''; } subMenu += '-'; var menuiD = 1, topMenu, menu; while (subMenu) { topMenu = $('topMenu' +subMenu +menuiD); menu = $('menu' +subMenu +menuiD); if (topMenu && menu) { getMenu(subMenu +menuiD); setMenu(topMenu, menu); } else { break; } menuiD++; } } setMenu = function (topMenu, menu) { var subMenu = /^menu-\d-/.test(menu.id); topMenuFuncrion = function () {setMenuPosition(topMenu, menu, subMenu); showMenu(menu, true)}; subMenu ? topMenu.onmouseover = topMenuFuncrion : topMenu.onclick = topMenuFuncrion; topMenu.onmouseout = function () {showMenu(menu, false)}; menu.onmouseover = function () {showMenu(menu, true)}; menu.onmouseout = function () {/*showMenu(menu, false)*/}; } setMenuPosition = function (topMenu, menu, subMenu) { menu.style.top = topMenu.offsetTop + (subMenu ? 0 : topMenu.offsetHeight) + 'px'; menu.style.left = topMenu.offsetLeft + (subMenu ? topMenu.offsetWidth : 0) + 'px'; } showMenu = function (menu, show) { menu.style.display = show ? 'block' : 'none'; } Kod body {margin: 5px; padding: 0; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px;} .menu, .topMenu {font-size: 12px; color: #000000; background-color: #f9f9f9; border: #000000 1px solid; white-space: nowrap;} .menu a, .topMenu a {color: #000000; text-decoration: none} .menu a:hover, .topMenu a:hover {background-color: #afcbe7; text-decoration: none;} .menu {display: none; position: absolute} .menu a {display: block; padding-right: 20px;} .menu a #arrow {font-weight: bold; position: absolute; right: 5px} Napisałem taki skrypt który wyswietla menu - a raczej powinien. Chodzi i zakomentowana czesc ze skryptu js dotyczaca akcji onmouseout. Po usunieciu komentarzy skrypt nie chce ustawic blokow w odpowiednim miejscu. Zreszta zobaczcie sami zakomentowaną werjse i i niezakomentowaną. Co jest nie tak? Ten post edytował emacieka 21.09.2006, 15:42:56 -------------------- ''' ... Among the blind one eyed man is a king ... '''
|
|
|
![]() ![]() |
![]() |
Aktualny czas: 19.08.2025 - 13:36 |