473,405 Members | 2,294 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,405 software developers and data experts.

Horizontal Menu doesn't work in IE

22
i m facing a new problem !....created a horizontal menu using javascript and css. it works well in firefoz but when i run it by IE it gers vertical :(.....any suggestion ....?
Feb 7 '07 #1
6 1796
acoder
16,027 Expert Mod 8TB
Please post your code.
Feb 7 '07 #2
junal
22
Please post your code.
--CSS code--
Expand|Select|Wrap|Line Numbers
  1. .nav2
  2. {
  3. float:left; width:900px; border:none; background:rgb(220,220,220) url(../img/bg_head_bottom_nav.jpg) repeat-x; color:rgb(75,75,75); font-size:1.0em; font-size:130%;
  4. }
  5.  
  6. .nav2 ul{
  7. margin: 0;
  8. padding: 0;
  9. list-style-type: none;
  10. }
  11.  
  12.  
  13. /*Top level list items*/
  14. .nav2 ul li{
  15. float:left; position:relative; z-index:1000; border-right:solid 1px rgb(175,175,175);
  16. }
  17.  
  18. /*Top level menu link items style*/
  19. .nav2 ul li a{
  20. float:none; 
  21. width:auto;
  22. display:block; height:3.1em; line-height:3.1em; padding:0 16px 0 16px; text-decoration:none; font-weight:bold; color: rgb(100,100,100);}
  23.  
  24. /*1st sub level menu*/
  25. .nav2 ul li ul{
  26. left: 0;
  27. position: absolute;
  28. top: 1em; /* no need to change, as true value set by script */
  29. display: block;
  30. visibility: hidden;
  31. background:url(../img/bg_head_bottom_nav_hover.gif) top center;
  32. }
  33.  
  34. .nav2 ul li:hover ul li a {display:block; width:10em; height:auto; line-height:1.3em; margin-left:-1px; padding:4px 16px 4px 24px; border-left:solid 1px rgb(175,175,175); border-bottom: solid 1px rgb(175,175,175); background-color:rgb(237,237,237); font-weight:normal; color:rgb(50,50,50);} /*Color subcells normal mode*/
  35. .nav2 ul li:hover ul li a:hover {background-color:rgb(210,210,210); text-decoration:none;}
  36.  
  37. .nav2 ul li a:hover ul {display:block; position:absolute;z-index: 998; top:3.1em; t\op:3.0em; left:0; marg\in-top:0.1em;}
  38. .nav2 ul li a:hover ul li a {display:block; width:10em; height:1px; line-height:1.3em; padding:0px 10px 0px 10px; border-left:solid 1px rgb(175,175,175); border-bottom: solid 0px rgb(175,175,175); background-color:rgb(237,237,237); font-weight:normal; color:rgb(50,50,50);} /*Color subcells normal mode*/
  39. .nav2 ul li a:hover .menuborder {border-bottom: solid 1px rgb(175,175,175);}
  40. .nav2 ul li a:hover ul li a ul {visibility:hidden; height:0px; width:0px; position:absolute; z-index: 997;}
  41. .nav2 ul li a:hover ul li a:hover {background-color:rgb(210,210,210); text-decoration:none;} /*Color subcells hovering mode*/
  42.  
  43. /*Sub level menu list items (undo style from Top level List Items)*/
  44. .nav2 ul li ul li{
  45. display: list-item;
  46. float: none;
  47. }
  48.  
  49. /*All subsequent sub menu levels offset after 1st level sub menu */
  50. .nav2 ul li ul li ul{ 
  51. left: 159px; /* no need to change, as true value set by script */
  52. top: 0;
  53. }
  54.  
  55. /* Sub level menu links style */
  56. .nav2 ul li ul li a{
  57. display: block;
  58. width: 160px; /*width of sub menu levels*/
  59. color: navy;
  60. text-decoration: none;
  61. padding: 1px 5px;
  62. border: 1px solid #ccc;
  63. }
  64.  
  65. .nav2 ul li a:hover{
  66. background-color:rgb(210,210,210); text-decoration:none;
  67. }
  68.  
  69. /*Background image for top level menu list links */
  70. .nav2 .mainfoldericon{
  71. background: #F3F3F3 url(media/arrow-down.gif) no-repeat center right;
  72. }
  73.  
  74. /*Background image for subsequent level menu list links */
  75. .nav2 .subfoldericon{
  76. background: #F3F3F3 url(media/arrow-right.gif) no-repeat center right;
  77. }
  78.  
  79. * html p#iepara{ /*For a paragraph (if any) that immediately follows suckertree menu, add 1em top spacing between the two in IE*/
  80. padding-top: 1em;
  81. }
  82.  
  83. * html .nav2 ul li { float: left; height: 1%;}
  84. * html .nav2 ul li a { height: 1%;}
  85. * html .nav2 ul li ul li { float: left;}
  86.  

--Javascript code--
Expand|Select|Wrap|Line Numbers
  1.  var menuids=["treemenu1"] //Enter id(s) of SuckerTree UL menus, separated by commas
  2.  
  3. function buildsubmenus_horizontal(){
  4. for (var i=0; i<menuids.length; i++){
  5. var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
  6. for (var t=0; t<ultags.length; t++){
  7.     if (ultags[t].parentNode.parentNode.id==menuids[i]){ //if this is a first level submenu
  8.         ultags[t].style.top=ultags[t].parentNode.offsetHeight+"px" //dynamically position first level submenus to be height of main menu item
  9.         //ultags[t].parentNode.getElementsByTagName("a")[0].className="mainfoldericon"
  10.     }
  11.     else{ //else if this is a sub level menu (ul)
  12.       ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
  13.     //ultags[t].parentNode.getElementsByTagName("a")[0].className="subfoldericon"
  14.     }
  15. ultags[t].parentNode.onmouseover=function(){
  16. this.getElementsByTagName("ul")[0].style.visibility="visible"
  17. }
  18. ultags[t].parentNode.onmouseout=function(){
  19. this.getElementsByTagName("ul")[0].style.visibility="hidden"
  20. }
  21. }
  22. }
  23. }
  24.  
  25.  
--html code---

[HTML] <div class="nav2">
<ul id="treemenu1">
<li><a href="index.html"">Home</a></li>

<li><a href="">Production</a>
<ul>
<li><a>Sampling</a>
<ul>
<li><a href="addsample.html">Add Sample</a></li>
<li><a href="addsample.html">View Sampling</a></li>
<li><a href="addsample.html">Edit Sampling</a></li>
<li><a href="addsample.html">Delete Sampling</a></li>

</ul>


</li>

<li><a>Production</a>

<ul>
<li><a href="addproduction.html">Add Production</a></li>
<li><a href="addproduction.html">View Production</a></li>
<li><a href="addproduction.html">Delete Production</a></li>
<li><a href="addproduction.html">Edit Production</a></li>
</ul>

</li>
<li><a href=>Report</a></li>


</ul>
</a>
</li>
<li><a href="#">Production Cost Management</a></li>
<li><a href="#">CRM</a></li>
<li><a href="#">Inventory</a></li>
<li><a href="#">User Management System</a></li>


</ul>
<br style="clear: left;" />
</div>[/HTML]
Code in tags - moderator
Feb 10 '07 #3
acoder
16,027 Expert Mod 8TB
I assume you are using this script. IE6, as you will know is a buggy browser that doesn't support CSS properly. There are some hacks to solve this. Have you been through the comments on that page? You may have to ask on the CSS forum. Your Javascript seems ok.
Feb 10 '07 #4
junal
22
I assume you are using this script. IE6, as you will know is a buggy browser that doesn't support CSS properly. There are some hacks to solve this. Have you been through the comments on that page? You may have to ask on the CSS forum. Your Javascript seems ok.
your right acoder. thx for the reply.
Feb 11 '07 #5
acoder
16,027 Expert Mod 8TB
You're welcome. Did it solve your problem?
Feb 12 '07 #6
junal
22
thx acoder. ya i solved my problem by css. thx for asking :)
Feb 14 '07 #7

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

Similar topics

13
by: elad | last post by:
Hi The Menu doesn't work properly when I have 2 frame and the Menu popup frame=document target frame, when I choose item in the menu the doc opened and the menu get stuck. Here is the code...
5
by: Peter Cartwright | last post by:
This works in IE6. A horizontal menu made from a table with the space created by a td class="gap". All tds are rendered as inline elements except for .gap. So links are equidistantly spaced. This...
7
by: addled | last post by:
Hi there, after reading posts here for a few months, I've built the courage to see if someone can see where I"m going wrong in the webpage I've been working on. In particular the horizontal nav...
3
by: Sonya | last post by:
Dear list; I am a css newbie, and hope you can help. I am trying to make my page print out horizontal when user hits a print button in my page. the print button invokes javascript print.window()...
0
by: nonsensitor | last post by:
I would like to provide a scalable horizontal menu. Here's the twist: I want to keep the menu items on a single line for as many 'upscales' as possible. So I basically need 2 solutions: 1) For...
1
by: camphor | last post by:
hi, I have a single column webpage with a horizontal dropdown menu and am trying to make the nav bar fit across the page, the column is 800px, it looks ok in dreamweaver 8 but when I test it in...
1
by: brixton | last post by:
Hello, silly problem maybe, but... I'm trying to get a horizontal menu to work with DIVs but I'm having trouble getting the menu items to "fill" the menu DIV. Basically I have a surrounding...
19
by: Jim | last post by:
Hi, I have two questions/problems pertaining to CSS horizontal dropdown menus and am hoping that someone here can help me out. (1) I'm having a problem centering the menu. I picked up the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
jinu1996
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...
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.