473,686 Members | 2,754 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

menu hover problem

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)
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>
Expand|Select|Wrap|Line Numbers
  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. }
  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;}
Omer Aslam
Jun 24 '09 #1
1 3799
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
it is conflicting with the left category menu is ther any option i can fix it
Omer Aslam
Jun 27 '09 #2

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

Similar topics

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 see addressed is what I need to do to get the same behaviour in all 3 browsers. I know each browser...
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
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.
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: left;
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 fine..but if user clicks outsite anywhere in screen then this problem occur.. i think it's css...
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 {
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 area.. how can i tackle this . The Error occurs only in IE not in Firefox. Here the Code : For...
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 problem. i have send menu_css.html file along with the layout.css file. thanks html file:
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 menu list get's too long due to some words being longer than others and then it doesn't fit on the...
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.