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

Css/java navbar problems in Firefox, works in IE

I have tried numerous suggestions and different codes without a firm solution, so I am hoping someone can take a look at my work and pin point my problem.

I have designed a website with a css/javascript vertical navigation sidebar. It looks and functions perfectly in IE. But in FF, it appears to function but the buttons are piled on top of each other and barely visible.

The page is http://www.azureflame.com/index.php

Here is the css:
Expand|Select|Wrap|Line Numbers
  1. <style>
  2. .sidenav ul
  3. {
  4. margin: 0;
  5. padding: 0;
  6. list-style-type: none;
  7. width: 160px;
  8. border-bottom: 1px solid #ccc;
  9. }
  10.  
  11. .sidenav ul li{
  12. position: relative;
  13. }
  14.  
  15. .sidenav ul li ul{
  16. position: absolute;
  17. width: 170px;
  18. top: 0;
  19. visibility: hidden;
  20. }
  21.  
  22. .sidenav ul li a{
  23. border-style:solid;
  24. border-color:#CAC29C;
  25. border-left:1px; 
  26. border-right:1px; 
  27. border-top:1px;
  28. border-bottom:0px;
  29. display: block;
  30. overflow: auto;
  31. color: white;
  32. text-decoration: none;
  33. padding-left:5px; 
  34. padding-right:5px; 
  35. padding-top:1px; 
  36. padding-bottom:1px;
  37. background-color:#CAC29C;
  38. background-repeat: repeat-x;
  39. background-position: bottom left;
  40. background-image:url('images/site/glossyback2.jpg');
  41. }
  42.  
  43. .sidenav ul li a:visited{
  44. color: white;
  45. }
  46. .sidenav ul li a:hover{
  47. background-color: #CAC29C;
  48. background-image: url('images/site/glossyback.jpg');
  49. }
  50.  
  51. .sidenav .subfolderstyle{
  52. background-color:#CAC29C;
  53. background-repeat: repeat-x;
  54. background-position: bottom left;
  55. background-image:url('images/site/glossyback2.jpg');
  56. }
  57.  
  58. html .sidenav ul li { 
  59. float: left; height: 1%; 
  60. }
  61. html .sidenav ul li a { 
  62. height: 1%; 
  63. }
  64.  
  65. </style>
----------------------------------------------------
Here is the html:
[html]
div class="sidenav" style="width: 139; height: 53">
<ul id="sidenav">
<li><a href="http://www.azureflame.com/index.php"><font size="1">HOME</font></a></li>
<li><a href="http://www.azureflame.com/news.php"><font size="1">NEWS</font></a>
<ul><li>etc, etc...</li></ul>
</li><li><a href="http://www.azureflame.com/rss.php"><font size="1">RSS AND PODCASTS</font></a></li>
</ul>
</ul></div>[/html]
----------------------------------------------------
and here is the javascript:
Expand|Select|Wrap|Line Numbers
  1. var menuids=["sidenav"] 
  2.  
  3. function buildsubmenus(){
  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.     ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
  8.         if (ultags[t].parentNode.parentNode.id==menuids[i]) 
  9.             ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px" 
  10.         else //else if this is a sub level submenu (ul)
  11.           ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" 
  12.     ultags[t].parentNode.onmouseover=function(){
  13.     this.getElementsByTagName("ul")[0].style.display="block"
  14.     }
  15.     ultags[t].parentNode.onmouseout=function(){
  16.     this.getElementsByTagName("ul")[0].style.display="none"
  17.     }
  18.     }
  19.         for (var t=ultags.length-1; t>-1; t--){ 
  20.         ultags[t].style.visibility="visible"
  21.         ultags[t].style.display="none"
  22.         }
  23.   }
  24. }
  25.  
  26. if (window.addEventListener)
  27. window.addEventListener("load", buildsubmenus, false)
  28. else if (window.attachEvent)
  29. window.attachEvent("onload", buildsubmenus)
Dec 14 '07 #1
3 1418
drhowarddrfine
7,435 Expert 4TB
Though IE does what you want, Firefox is doing what you coded. The problem is IE. You have no doctype. Without a proper doctype, IE goes into quirks mode and acts like it's 1998 rather than like modern browsers such as Firefox. See the article about doctypes under Howtos above.

You have 61 html errors and 7 CSS errors.

You use a xhtml namespace but don't declare xhtml with a doctype.
Dec 14 '07 #2
Ah-ha! Now we're getting somewhere :) Thank you for your reply. I'm already seeing results. I apparently have a whole lot of rescripting to do on the entire site, but your HOWTO articles are going to help the quality immensely!!! Funny how I always thought (until about 2 days ago) that IE was the superior browser - LOL!!!
Dec 14 '07 #3
drhowarddrfine
7,435 Expert 4TB
Yes. IE7 is 10 years behind current web standards while all other browsers are reasonably up to date. IE is the worst browser on the planet.
Dec 14 '07 #4

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

Similar topics

3
by: David | last post by:
I made a navbar where the buttons light up when the user moves over them. The only problem was in IE the buttons only light up when hovering over the text. This was not a problem in opera!...
7
by: Roger Withnell | last post by:
www.brilley.co.uk/testMenusMac.asp demonstrates the problem. It works in IBM-IE5 but two problems in Mac-IE5 (I've positioned the popup menus on the page to observe the problem). The popup menus...
2
by: Wiz | last post by:
Greetings the group! I see from a few previous postings that I am not the only person having a problem with hidden list item bullets. This question applies to both IE 6, current version, and...
1
by: Bob Richardson | last post by:
I'm in the process of changing from a framed to non-framed web. My test site is: http://www.writeonwhidbey.org/_private/ssi/ssitestBOB.html The scrolling navbar, that stays fixed at the top of...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
1
by: atombee | last post by:
Hi- this is the project that will not end! (sure you've all been there). I had originally purchased a php/css nav bar for the client, but it was buggy as hell, so I decided to do in css, in which I...
3
by: Jimbo | last post by:
I have a website & applet produced under Windows-XP. It works fine. I took it to a machine running Windows 98 & an earlier version of Java to test what happens when I open the web page using IE6 &...
2
by: dartanian | last post by:
I have a fluid horizontal navbar on my website which is formatted using floats and percentage widths to make it fluid. This looks great in WinXP Firefox, Opera, and even IE6. Safari and IE7 render...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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: 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...

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.