473,396 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Jquery menu Sub-Menu moving up slightly on hover in IE

347 100+
I have built a Jquery horizontal sub menu which gets data from asp and works fine in all browsers apart from IE, in ie when you hover over main buttons sub menu appears and when you move uver the sub menu it moves up a few pixels... really annoying?? Im sure its in the css somewhere.

CSS code
Expand|Select|Wrap|Line Numbers
  1. <style>
  2. body {
  3.     background-color: #000;
  4. }
  5. /*Drop Down Menu Styles*/
  6. #ddmenu {
  7.     margin: 0;
  8.     margin-left: -2px;
  9.     padding: 0;
  10.     height:43px;
  11.     width:1000px;
  12. }
  13.  
  14. #ddmenu li {   
  15.     float: left;
  16.     list-style: none;
  17.     font: 16px Arial, Helvetica, sans-serif;
  18. }
  19.  
  20. #ddmenu li a { 
  21.     display: block;
  22.     padding: 0px 0px;
  23.     text-decoration: none;
  24.     width: auto;
  25.     white-space: nowrap;
  26.     text-align:center;
  27.     font-weight:bold;
  28. }
  29.  
  30. #ddmenu li a:hover {   
  31.     color: #ef007b;
  32.     font-weight: 800;
  33. }
  34. #ddmenu li ul {
  35.     margin: -6px 0 0 3px;
  36.     padding: 0;
  37.     position: absolute;
  38.     visibility: hidden;
  39.     width:200px;
  40.     background-color:#f39617;
  41. }
  42.  
  43. #ddmenu li ul li { 
  44.     display:inline;
  45.     width: 200px;
  46. }
  47.  
  48. #ddmenu li ul li a {
  49.     width:auto;   
  50.     display: inline;
  51.     color: #000;
  52.     font-size: 13px;
  53.     padding: 2px 10px;
  54.     font-weight: 800;
  55. }
  56.  
  57.  
  58. .menu_class {
  59.     border-left:medium solid #000;
  60.     border-right:medium solid #000;
  61.     border-bottom:medium solid #000;
  62.     width: auto;
  63.     -moz-border-radius: 10px;
  64.     -ms-border-radius: 10px;
  65.     -o-border-radius: 10px;
  66.     -webkit-border-radius: 10px;
  67.     border-radius: 10px;
  68. }
  69.  
  70. .menu_class2 {
  71.     border-top:medium solid #000;
  72.     width: 100%;
  73.     -moz-border-radius: 10px;
  74.     -ms-border-radius: 10px;
  75.     -o-border-radius: 10px;
  76.     -webkit-border-radius: 10px;
  77.     border-radius: 10px;
  78. }
  79. </style>
  80.  
JQuery code

Expand|Select|Wrap|Line Numbers
  1. <script>
  2. $(document).ready(function () {
  3. // <![CDATA[
  4.     var timeout    = 500;
  5.     var closetimer = 0;
  6.     var ddmenuitem = 0;
  7.  
  8.     function ddmenu_open(){
  9.         ddmenu_canceltimer();
  10.            ddmenu_close();
  11.            ddmenuitem = $(this).find('ul').css('visibility', 'visible');
  12.     }
  13.  
  14.     function ddmenu_close(){
  15.         if(ddmenuitem) ddmenuitem.css('visibility', 'hidden');
  16.     }
  17.  
  18.     function ddmenu_timer(){
  19.         closetimer = window.setTimeout(ddmenu_close, timeout);
  20.     }
  21.  
  22.     function ddmenu_canceltimer(){ 
  23.         if(closetimer){ 
  24.             window.clearTimeout(closetimer);
  25.                 closetimer = null;
  26.     }}
  27.  
  28.     $(document).ready(function(){ 
  29.         $('#ddmenu > li').bind('mouseover', ddmenu_open)
  30.         $('#ddmenu > li').bind('mouseout',  ddmenu_timer)
  31.     });
  32.  
  33.     document.onclick = ddmenu_close;
  34. // ]]>  
  35. });
  36.  
  37.  
  38. </script>
  39.  
HTML code
Expand|Select|Wrap|Line Numbers
  1. <ul id="ddmenu">
  2.  <li><a href="boys2.asp?id=386&voicetype=All"><img src="http://bytes.com/submit/images/voicetypes/tabs/mainpage_up.png" alt="Main Page" id="mainpage" onMouseOver="MM_swapImage('mainpage','','../images/voicetypes/tabs/mainpage_dn.png',1)" onMouseOut="MM_swapImgRestore()" border="0"></a></li>
  3.  
  4.  
  5.  
  6.     <li><a href="javascript:void(0)"><img src="http://bytes.com/submit/images/voicetypes/tabs/Ages_up.png" alt="Ages" id="Ages" onMouseOver="MM_swapImage('Ages','','../images/voicetypes/tabs/Ages_dn.png',1)" onMouseOut="MM_swapImgRestore()" border="0"></a>
  7.         <ul class="menu_class">
  8.  
  9.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=20s-30s" >20's - 30's</a></li>
  10.  
  11.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=30s" >30s</a></li>
  12.  
  13.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=30s-40s" >30's - 40's</a></li>
  14.  
  15.         </ul>         
  16.     </li>
  17.  
  18.  
  19.  
  20.     <li><a href="javascript:void(0)"><img src="http://bytes.com/submit/images/voicetypes/tabs/Styles_up.png" alt="Styles" id="Styles" onMouseOver="MM_swapImage('Styles','','../images/voicetypes/tabs/Styles_dn.png',1)" onMouseOut="MM_swapImgRestore()" border="0"></a>
  21.         <ul class="menu_class">
  22.  
  23.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Animation/Cartoon" >Animation/Cartoon</a></li>
  24.  
  25.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Authoritative" >Authoritative</a></li>
  26.  
  27.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Characterful/Quirky" >Characterful/Quirky</a></li>
  28.  
  29.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Comedy/Humorous" >Comedy/Humorous</a></li>
  30.  
  31.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Deep/Powerful/Dramatic" >Deep/Powerful/Dramatic</a></li>
  32.  
  33.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Documentary/Corporate" >Documentary/Corporate</a></li>
  34.  
  35.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Friendly/Upbeat" >Friendly/Upbeat</a></li>
  36.  
  37.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Impressions" >Impressions</a></li>
  38.  
  39.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Kid-Friendly" >Kid Friendly</a></li>
  40.  
  41.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Movie-Trailer" >Movie Trailer</a></li>
  42.  
  43.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Sports-Commentator" >Sports Commentator</a></li>
  44.  
  45.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Versatile" >Versatile</a></li>
  46.  
  47.         </ul>         
  48.     </li>
  49.  
  50.  
  51.  
  52.     <li><a href="javascript:void(0)"><img src="http://bytes.com/submit/images/voicetypes/tabs/World Accents_up.png" alt="World Accents" id="World Accents" onMouseOver="MM_swapImage('World Accents','','../images/voicetypes/tabs/World Accents_dn.png',1)" onMouseOut="MM_swapImgRestore()" border="0"></a>
  53.         <ul class="menu_class">
  54.  
  55.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Australian" >Australian</a></li>
  56.  
  57.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Dutch" >Dutch</a></li>
  58.  
  59.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=French" >French</a></li>
  60.  
  61.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Mexican" >Mexican</a></li>
  62.  
  63.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Oriental" >Oriental</a></li>
  64.  
  65.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Russian" >Russian</a></li>
  66.  
  67.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=South-African" >South African</a></li>
  68.  
  69.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Spanish" >Spanish</a></li>
  70.  
  71.         </ul>         
  72.     </li>
  73.  
  74.  
  75.  
  76.     <li><a href="javascript:void(0)"><img src="http://bytes.com/submit/images/voicetypes/tabs/UK Accents_up.png" alt="UK Accents" id="UK Accents" onMouseOver="MM_swapImage('UK Accents','','../images/voicetypes/tabs/UK Accents_dn.png',1)" onMouseOut="MM_swapImgRestore()" border="0"></a>
  77.         <ul class="menu_class">
  78.  
  79.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Neutral" >Neutral</a></li>
  80.  
  81.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Irish" >Irish</a></li>
  82.  
  83.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=Scottish" >Scottish</a></li>
  84.  
  85.         </ul>         
  86.     </li>
  87.  
  88. <li><a href="boys2.asp?id=386&voicetype=USA/Mid-Atlantic"><img src="http://bytes.com/submit/images/voicetypes/tabs/usa mid atlantic_up.png" alt="Main Page" id="usamid" onMouseOver="MM_swapImage('usamid','','../images/voicetypes/tabs/usa mid atlantic_dn.png',1)" onMouseOut="MM_swapImgRestore()" border="0"></a>
  89. </li>
  90.  
  91.  
  92.  
  93.     <li><a href="javascript:void(0)"><img src="http://bytes.com/submit/images/voicetypes/tabs/Foreign Languages_up.png" alt="Foreign Languages" id="Foreign Languages" onMouseOver="MM_swapImage('Foreign Languages','','../images/voicetypes/tabs/Foreign Languages_dn.png',1)" onMouseOut="MM_swapImgRestore()" border="0"></a>
  94.         <ul class="menu_class">
  95.  
  96.         <li class="menu_class2"><a href="boys2.asp?id=386&voicetype=French-Language" >French Language</a></li>
  97.  
  98.         </ul>         
  99.     </li>
  100.  
  101. </ul>  
  102.  
the page can be seen here http://www.yaketyyak.co.uk/newpages/...&voicetype=All

Thanks
Mar 5 '13 #1
2 2136
Dormilich
8,658 Expert Mod 8TB
do you use IE in quirks mode? then it could be explained with the different box models.
Mar 5 '13 #2
colinod
347 100+
I have tried all modes in ie and its fine in ie7 and ie8 mode useless in quirks and moves in ie9?
Mar 6 '13 #3

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

Similar topics

6
by: Gale | last post by:
I'm working on something in jQuery with XPath What I want to do is: if checkbox is checked, set background color od label that contain input(checkbox) to red I have this code:...
1
by: DuaneMoraes | last post by:
A new book on jQuery, the powerful JavaScript library, has been announced by Packt In Learning jQuery, Karl Swedberg and Jonathan Chaffer, creators of the popular jQuery learning resource...
1
by: mikeh3275 | last post by:
I'm new to developing in jQuery, so I'm probably doing this wrong. I'm loading a form into a modal dialog box and I'm trying to assign a click event to the button in the form, but I can't seem to...
20
by: Aaron Gray | last post by:
There does not seem too be anyway to test if two jQuery references are the same element. Given :- ... <div id="1"></div .... Then :- alert( $("#1") == $("#1"))
26
by: RobG | last post by:
Do some of the regulars here need to re-think their (sometimes strident) opposition to libraries? Both Microsoft and Nokia have announced support for jQuery. It seems to have gained quite a bit...
2
by: souporpower | last post by:
Hi All I am trying to print some HTML using JQUERY. I am posting the code. I don't see the alert. It seems as though the function is not registered when the document is loaded. Can someone...
53
by: souporpower | last post by:
Hello All I am trying to activate a link using Jquery. Here is my code; <html> <head> <script type="text/javascript" src="../../resources/js/ jquery-1.2.6.js"</script> <script...
6
by: aaronkmar | last post by:
Trying to get a loading image to spin while the query is loading. I can get the data div to fade in, but I can't seem to figure out how to get the gif while the query is loading. I'm using two...
5
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums...
0
by: empiresolutions | last post by:
I'm building a navigation that is built heavily on jQuery. I have it working as needed except that when mousing over links to quickly it spikes the processor and the navigation hangs. By hangs i mean...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...
0
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...
0
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...

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.