I have created a simple css menu, which opens the submenu when the mouse hovers over the menu items. This goes a little too fast, so I want to change it into a click (onMouseUp I suppose) so the submenu items appear when one of the menu items is clicked. Is it possible with css to achieve this?
My css code:
Code:
#menu li {list-style-type: none;}
#menu li a {text-decoration: none; color: #000000;}
#menu ul li:hover {position:relative; list-style-image:url(images/list1.png);}
#menu ul { line-height: 35px; font-size: 22px;}
/*submenu*/
#menu ul ul {
display: none;
position: relative;
line-height: 24px;
font-size: 18px;
list-style: disc;
}
#menu ul li:hover ul {display:block;}
Hmm, I spoke too soon. When testing offline, everything works fine. When I test it online (in Internet Explorer and Chrome) it 'blocks' other code that I use for a simple lightbox. The page jumps to the top but no lightbox appears. Internet Explorer also shows an error: 'subMenusO' is undefined.
This is the code for the lightbox, if it helps you.
Code:
var curr_lb_div;
var is_modal = false;
function ShowLightBox(lb_div, isModal) {
document.getElementById(lb_div).style.display='block';
document.getElementById('fade').style.display='block';
curr_lb_div = lb_div;
if (isModal)
is_modal = true;
else is_modal = false;
}
function HideLightBox() {
if (document.getElementById(curr_lb_div)) {
document.getElementById(curr_lb_div).style.display='none';
document.getElementById('fade').style.display='none';
curr_lb_div = '';
}
}
Do you know what could be the problem?
EDIT: I noticed some other code also uses window.onload, so I merged them together. Now IE doesn't show the error anymore, but the lightbox still isn't showing...
Or shall I move this topic to the Javascript section?
Bookmarks