menu hover problem 
June 24th, 2009, 05:53 PM
|  | Needs Regular Fix | | Join Date: Nov 2006 Location: Earth Obviously :P
Posts: 340
| |
hi every one i have a menu li and ul based the problem is when any specific category in the li is hovered the li or the sub-cat items appear but as i move my mouse over the sub-cat or level two li it disappears can any one help in this
here is the link you can watch the left menu here link
here is the code -
var menuids=["suckertree1"] //Enter id(s) of SuckerTree UL menus, separated by commas
-
function buildsubmenus(){
-
for (var i=0; i<menuids.length; i++){
-
var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
-
for (var t=0; t<ultags.length; t++){
-
ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
-
if (ultags[t].parentNode.parentNode.id==menuids[i]) //if this is a first level submenu
-
ultags[t].style.left=(ultags[t].parentNode.offsetWidth-2)+"px" //dynamically position first level submenus to be width of main menu item
-
else //else if this is a sub level submenu (ul)
-
ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
-
ultags[t].parentNode.onmouseover=function(){
-
this.getElementsByTagName("ul")[0].style.display="block"
-
}
-
ultags[t].parentNode.onmouseout=function(){
-
this.getElementsByTagName("ul")[0].style.display="none"
-
}
-
}
-
for (var t=ultags.length-1; t>-1; t--){ //loop through all sub menus again, and use "display:none" to hide menus (to prevent possible page scrollbars
-
ultags[t].style.visibility="visible"
-
ultags[t].style.display="none"
-
}
-
}
-
}
-
if (window.addEventListener)
-
window.addEventListener("load", buildsubmenus, false)
-
else if (window.attachEvent)
-
window.attachEvent("onload", buildsubmenus)
-
-
<?
-
function createMenu($parId){
-
$q="select
-
c.cat_id,
-
c.parent_id,
-
cd.cat_name
-
from
-
".CATEGORY." c,
-
".CATEGORY_DESCRIPTION." cd
-
where
-
(c.cat_id=cd.cat_id)
-
and
-
(c.parent_id='$parId')";
-
$r=execute($q);
-
while($row_cat=mysql_fetch_array($r)){
-
$q_s="select c.cat_id, cd.cat_name from ".CATEGORY." c, ".CATEGORY_DESCRIPTION." cd where (c.cat_id=cd.cat_id) and c.parent_id='$row_cat[cat_id]'";
-
$r_s=execute($q_s);
-
$noRows=mysql_num_rows($r_s);
-
if($noRows > 0){?>
-
<li><a href="products.php?bingo=<?php echo $row_cat['cat_id'];?>" class='WhiteNormal'> <strong>></strong><?php echo " ".$row_cat['cat_name'];?></a>
-
<ul>
-
<?php createMenu($row_cat['cat_id']);?>
-
</ul>
-
</li>
-
<?php }else{?>
-
<li><a href="products.php?bingo=<?php echo $row_cat['cat_id'];?>" class='WhiteNormal'><?php echo " ".$row_cat['cat_name'];?></a></li><?php
-
}
-
}//end while
-
}?>
-
<tr>
-
<td align="center" valign="middle">
-
<table cellspacing="0" cellpadding="0" border="0" align="center" width="230" class="menuHeader_left_top ">
-
<tr>
-
<td align="right" valign="middle" width="40"><img src="images/img-019.png" width="11" height="11" border="0" align="middle" alt="none" /></td>
-
<td align="left" valign="middle" class="text_14_grey_dark_bold arrow_bg"> CATEGORY</td>
-
</tr>
-
</table>
-
</td>
-
</tr>
-
<tr>
-
<td align="center" valign="middle">
-
<table cellspacing="0" cellpadding="0" align="center" width="234">
-
<tr>
-
<td align="center" valign="middle">
-
<table cellspacing="0" cellpadding="0" border="0" align="center" width="234">
-
<tr>
-
<td align="left" valign="middle" width="234">
-
<div class="suckerdiv">
-
<ul id="suckertree1">
-
<?php
-
createMenu(0);
-
?>
-
</ul>
-
</div>
-
</td>
-
</tr>
-
</table>
-
</td>
-
</tr>
-
</table>
-
</td>
-
</tr>
-
-
/*SUCKER DIV MENU*/
-
.suckerdiv ul{
-
font-family: Arial, Helvetica, sans-serif;
-
font-size: 14px;
-
margin: 0;
-
padding: 0;
-
list-style-type: none;
-
width: 234px; /* Width of Menu Items */
-
background: #ffffff;
-
z-index:1;
-
}
-
.suckerdiv ul li{
-
font-family: Arial, Helvetica, sans-serif;
-
font-size: 14px;
-
position: relative;
-
line-height:29px;
-
z-index:1;
-
}
-
-
/*Sub level menu items */
-
.suckerdiv ul li ul{
-
font-family: Arial, Helvetica, sans-serif;
-
font-size: 14px;
-
position: absolute;
-
visibility: hidden;
-
width: 234px; /*sub menu width*/
-
top: 0;
-
z-index:1;
-
border:1px solid #ffffff;
-
border-top-color:#e8e8e8;
-
border-bottom-color:#e8e8e8;
-
}
-
/* Sub level menu links style */
-
.suckerdiv ul li a{
-
font-family: Arial, Helvetica, sans-serif;
-
font-size: 14px;
-
font-weight:normal;
-
display: block;
-
overflow: auto; /*force hasLayout in IE7 */
-
color:#191c2b;
-
text-decoration: none;
-
width:232px;
-
height:29px;
-
z-index:1;
-
border:1px solid #ffffff;
-
border-right-color:#e8e8e8;
-
border-left-color:#e8e8e8;
-
background:url(../images/img-014.png) 8px 25px no-repeat;
-
}
-
.suckerdiv ul li a:visited{
-
font-family:Arial, Helvetica, sans-serif;
-
font-size: 14px;
-
color: #333333;
-
}
-
.suckerdiv ul li a:hover{
-
font-family: Arial, Helvetica, sans-serif;
-
font-size: 14px;
-
width:234px;
-
height:29px;
-
border:1px solid #FFFFFF;
-
border-left-color:#e8e8e8;
-
/*background-color: #FF9900;background-color: #FFD89C;*/
-
}
-
.suckerdiv .subfolderstyle{
-
font-family: Arial, Helvetica, sans-serif;
-
font-size: 14px;
-
background:url(../images/img-014.png) 8px 25px no-repeat;
-
z-index:100;
-
}
-
/* Holly Hack for IE \*/
-
* html .suckerdiv ul li { float:left; height: 1%; z-index:2000;}
-
* html .suckerdiv ul li a { height: 1%; z-index:2000;}
-
regards,
Omer Aslam
| 
June 27th, 2009, 08:17 AM
|  | Needs Regular Fix | | Join Date: Nov 2006 Location: Earth Obviously :P
Posts: 340
| | | re: menu hover problem
i i have found the problem it was not in this menu but i had another top menu named as lavalamp i downloaded it from here lavalamp
it is conflicting with the left category menu is ther any option i can fix it
regards,
Omer Aslam
| | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,662 network members.
|