473,568 Members | 2,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

menu hover problem

omerbutt
638 Contributor
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
Expand|Select|Wrap|Line Numbers
  1. var menuids=["suckertree1"] //Enter id(s) of SuckerTree UL menus, separated by commas
  2. function buildsubmenus(){
  3. for (var i=0; i<menuids.length; i++){
  4.   var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
  5.     for (var t=0; t<ultags.length; t++){
  6.     ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
  7.         if (ultags[t].parentNode.parentNode.id==menuids[i]) //if this is a first level submenu
  8.             ultags[t].style.left=(ultags[t].parentNode.offsetWidth-2)+"px" //dynamically position first level submenus to be width of main menu item
  9.         else //else if this is a sub level submenu (ul)
  10.           ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
  11.     ultags[t].parentNode.onmouseover=function(){
  12.     this.getElementsByTagName("ul")[0].style.display="block"
  13.     }
  14.     ultags[t].parentNode.onmouseout=function(){
  15.     this.getElementsByTagName("ul")[0].style.display="none"
  16.     }
  17.     }
  18.         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
  19.         ultags[t].style.visibility="visible"
  20.         ultags[t].style.display="none"
  21.         }
  22.   }
  23. }
  24. if (window.addEventListener)
  25. window.addEventListener("load", buildsubmenus, false)
  26. else if (window.attachEvent)
  27. window.attachEvent("onload", buildsubmenus)
  28.  
Expand|Select|Wrap|Line Numbers
  1. <?
  2. function createMenu($parId){
  3.     $q="select 
  4.         c.cat_id,
  5.         c.parent_id,
  6.         cd.cat_name
  7.     from
  8.         ".CATEGORY." c,
  9.         ".CATEGORY_DESCRIPTION." cd
  10.     where
  11.         (c.cat_id=cd.cat_id)
  12.     and
  13.         (c.parent_id='$parId')";
  14.     $r=execute($q);
  15.     while($row_cat=mysql_fetch_array($r)){
  16.         $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]'";
  17.         $r_s=execute($q_s);
  18.         $noRows=mysql_num_rows($r_s);
  19.         if($noRows > 0){?>
  20.             <li><a href="products.php?bingo=<?php echo $row_cat['cat_id'];?>" class='WhiteNormal'>&nbsp;&nbsp;&nbsp;<strong>></strong><?php echo "&nbsp;&nbsp;".$row_cat['cat_name'];?></a>
  21.                 <ul>
  22.                     <?php createMenu($row_cat['cat_id']);?>
  23.                 </ul>
  24.             </li>
  25.         <?php }else{?>
  26.             <li><a href="products.php?bingo=<?php echo $row_cat['cat_id'];?>" class='WhiteNormal'><?php echo "&nbsp;&nbsp;".$row_cat['cat_name'];?></a></li><?php 
  27.         }
  28.     }//end while
  29. }?>
  30. <tr>
  31.     <td align="center" valign="middle">
  32.         <table cellspacing="0" cellpadding="0" border="0" align="center" width="230" class="menuHeader_left_top ">
  33.             <tr>
  34.                 <td align="right" valign="middle" width="40"><img src="images/img-019.png" width="11" height="11" border="0" align="middle" alt="none" /></td>
  35.                 <td align="left" valign="middle" class="text_14_grey_dark_bold arrow_bg">&nbsp;&nbsp;CATEGORY</td>
  36.             </tr>
  37.         </table>
  38.     </td>
  39. </tr>
  40. <tr>
  41.     <td align="center" valign="middle">
  42.         <table cellspacing="0" cellpadding="0" align="center" width="234">
  43.             <tr>
  44.                 <td align="center" valign="middle">
  45.                     <table cellspacing="0" cellpadding="0" border="0" align="center" width="234">
  46.                          <tr>
  47.                             <td align="left" valign="middle" width="234">
  48.                                 <div class="suckerdiv">
  49.                                 <ul id="suckertree1">
  50.                                 <?php             
  51.                                     createMenu(0);
  52.                                 ?>
  53.                                 </ul>
  54.                                 </div>
  55.                             </td>
  56.                         </tr>
  57.                     </table>
  58.                 </td>
  59.             </tr>
  60.         </table>
  61.     </td>
  62. </tr>
  63.  
Expand|Select|Wrap|Line Numbers
  1. /*SUCKER DIV MENU*/
  2. .suckerdiv ul{
  3.     font-family: Arial, Helvetica, sans-serif;
  4.       font-size: 14px;
  5.     margin: 0;
  6.     padding: 0;
  7.     list-style-type: none;
  8.     width: 234px; /* Width of Menu Items */
  9.     background: #ffffff;
  10.     z-index:1;
  11. }
  12. .suckerdiv ul li{
  13.     font-family: Arial, Helvetica, sans-serif;
  14.       font-size: 14px;
  15.     position: relative;
  16.     line-height:29px;
  17.     z-index:1;
  18. }
  19.  
  20. /*Sub level menu items */
  21. .suckerdiv ul li ul{
  22.     font-family: Arial, Helvetica, sans-serif;
  23.       font-size: 14px;
  24.     position: absolute;
  25.     visibility: hidden;
  26.     width: 234px; /*sub menu width*/
  27.     top: 0;
  28.     z-index:1;
  29.     border:1px solid #ffffff;
  30.     border-top-color:#e8e8e8;
  31.     border-bottom-color:#e8e8e8;
  32. }
  33. /* Sub level menu links style */
  34. .suckerdiv ul li a{
  35.     font-family: Arial, Helvetica, sans-serif;
  36.       font-size: 14px;
  37.     font-weight:normal;
  38.     display: block;
  39.     overflow: auto; /*force hasLayout in IE7 */
  40.     color:#191c2b;
  41.     text-decoration: none;
  42.     width:232px;
  43.     height:29px;
  44.     z-index:1;
  45.     border:1px solid #ffffff;
  46.     border-right-color:#e8e8e8;
  47.     border-left-color:#e8e8e8;
  48.     background:url(../images/img-014.png) 8px 25px no-repeat;
  49. }
  50. .suckerdiv ul li a:visited{
  51.     font-family:Arial, Helvetica, sans-serif;
  52.       font-size: 14px;
  53.     color: #333333;
  54. }
  55. .suckerdiv ul li a:hover{
  56.     font-family: Arial, Helvetica, sans-serif;
  57.       font-size: 14px;
  58.     width:234px;
  59.     height:29px;
  60.     border:1px solid #FFFFFF;
  61.     border-left-color:#e8e8e8;
  62.     /*background-color: #FF9900;background-color: #FFD89C;*/
  63. }
  64. .suckerdiv .subfolderstyle{
  65.     font-family: Arial, Helvetica, sans-serif;
  66.       font-size: 14px;
  67.     background:url(../images/img-014.png) 8px 25px no-repeat;
  68.     z-index:100;
  69. }
  70. /* Holly Hack for IE \*/
  71. * html .suckerdiv ul li { float:left; height: 1%; z-index:2000;}
  72. * html .suckerdiv ul li a { height: 1%; z-index:2000;}
  73.  
regards,
Omer Aslam
Jun 24 '09 #1
1 3791
omerbutt
638 Contributor
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
Jun 27 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2477
by: Macamba | last post by:
Hi all, I am currently developing a website for a voluntary organisation. It is my first step in website development. The dynamic menu I developed has some bugs, which I addressed in another post. In this post I want to ask you why my code behaves differently in IE, while it behaves like I expect in Mozilla and Opera. What I would like to...
0
16151
by: vikram.cvk | last post by:
Hello Experts, Im trying to design a CSS vertical drop down menu which should have the following functionality. Home About Us | -->Overview
4
9278
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me if it works, and if it does not, tell me why it does not work. Thanks.
4
4189
by: tonsi | last post by:
I have a css menu that works great in IE7 and other browser but when you check it in IE 6 it only shows the first dropdown. I am not that great at css but ANY help would be greatly appreciated. here is the site I am having trouble with. http://www.866hdrental.com/new_site/index.htm here is the navigation css: .moveover { text-align:...
2
2258
by: Ravi Joshi | last post by:
The menu on my site works fine in IE6 and Firefox. In IE7, there is a problem with the menu: when you mouse over the various main catagories, the sub-catagories all appear to the right as they should; however, as soon as you mouse towards any but the TOP sub-catagory, all those sub-catagories still view there. It will work first time quite...
2
3504
by: namratha247 | last post by:
Hi, Can anybody please help me with this problem. In my application, I'm using Menus. and the CSS for the menu is as given below ccMenu.css /* Root = Horizontal, Secondary = Vertical */ ul#navmenu {
3
7376
by: tceramesh | last post by:
Hi Friends, I Created one drop down menu by using CSS. It is perfect in Firefox but in IE it creates some problem. in the header section the drop down menu appear,, below that i used one table to put one list menu box.. The problem is, when we mouse over the drop down menu , list box appears in front of the drop down...
0
2941
by: rahullko05 | last post by:
i have designed a menu list program in which i'm facing a problem where the last li item (white crappie) shifts down when i hover mouse pointer to just above li item (ozrack bazz) of white crappie instead (white crappie) li item should be to be sticked just below (ozrack bazz) li item without a down shift. i request u all to kindly sort the...
5
5832
by: jerry101 | last post by:
Hi, I've been working on a horizontal drop down menu today, and I can get it to display perfectly in everything bar IE6. Basically instead of them lining up horizontally, they line up vertically instead. And this only happens when I don't give the LI in the menu list and fixed width, which I don't want because if I have a fixed width the...
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7916
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6275
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5498
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.