473,499 Members | 1,533 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Firefox incompatibility for Popup menu

4 New Member
First off this is my brothers code for his website but he has task'd me with the job of finding a solution. He has the following javascript code for a popup menu which works fine in IE but not FF. Instead of the menu items popping up like the do in IE they are just all displayed vertically already open like standard buttons. The individual items that should popup also now have little circles to the left of them

Expand|Select|Wrap|Line Numbers
  1. var menuids=new Array("verticalmenu") //Enter id(s) of UL menus, separated by commas
  2. var submenuoffset=-2 //Offset of submenus from main menu. Default is -2 pixels.
  3.  
  4. function createcssmenu(){
  5. for (var i=0; i<menuids.length; i++){
  6.   var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
  7.     for (var t=0; t<ultags.length; t++){
  8.     var spanref=document.createElement("span")
  9.         spanref.className="arrowdiv"
  10.         spanref.innerHTML="&nbsp;&nbsp;"
  11.         ultags[t].parentNode.getElementsByTagName("a")[0].appendChild(spanref)
  12.     ultags[t].parentNode.onmouseover=function(){
  13.     this.getElementsByTagName("ul")[0].style.left=this.parentNode.offsetWidth+submenuoffset+"px"
  14.     this.getElementsByTagName("ul")[0].style.display="block"
  15.     }
  16.     ultags[t].parentNode.onmouseout=function(){
  17.     this.getElementsByTagName("ul")[0].style.display="none"
  18.     }
  19.     }
  20.   }
  21. }
  22.  
  23.  
  24. if (window.addEventListener)
  25. window.addEventListener("load", createcssmenu, false)
  26. else if (window.attachEvent)
  27. window.attachEvent("onload", createcssmenu)
  28.  
  29.  
Dec 10 '07 #1
8 2287
acoder
16,027 Recognized Expert Moderator MVP
Welcome to TSDN!

Post the HTML and CSS code for the popup menu.
Dec 10 '07 #2
ThePirate
4 New Member
CSS:

Expand|Select|Wrap|Line Numbers
  1.  
  2. .glossymenu, .glossymenu li ul{
  3. list-style-type: none;
  4. left: 140;
  5. top: 0;
  6. margin: 0;
  7. padding: 0;
  8. width: 140px; /*WIDTH OF MAIN MENU ITEMS*/
  9. border: 0px solid black;
  10. }
  11.  
  12. .glossymenu li{
  13. position: relative;
  14. }
  15.  
  16. .glossymenu li ul{ /*SUB MENU STYLE*/
  17. position: absolute;
  18. width: 140px; /*WIDTH OF SUB MENU ITEMS*/
  19. left: 0;
  20. top: 0;
  21. display: none;
  22. filter:alpha(opacity=100);
  23. -moz-opacity:1;
  24. }
  25.  
  26. .glossymenu li a{
  27. background: #6E6943 url(../images/button.jpg) repeat-x bottom left;
  28. font: bold 16px arial;
  29. color: #d8cd8d;
  30. display: block;
  31. width: auto;
  32. padding: 5px 0;
  33.  
  34. padding-bottom: 7px;
  35. text-decoration: none;
  36. }
  37.  
  38. .glossymenu .arrowdiv{
  39. position: absolute;
  40. right: 9px;
  41. background: transparent url() no-repeat center right;
  42. }
  43.  
  44. .glossymenu li a:visited, .glossymenu li a:active{
  45. color: #d8cd8d;
  46. }
  47.  
  48. .glossymenu li a:hover{
  49. background-image: url(../images/button2.jpg);
  50. }
  51.  
  52. /* Holly Hack for IE \*/
  53. * html .glossymenu li { float: left; height: 1%; }
  54. * html .glossymenu li a { height: 1%; }
  55. /* End */
  56.  
I'm not sure where the HTML is for this as it's my brothers site so I will try to find out from him. I can also see if he can set up a dummy account so you can login and see the problem for yourself if that's helpful.
Dec 11 '07 #3
drhowarddrfine
7,435 Recognized Expert Expert
There is no html in that. A link would be good.
Dec 11 '07 #4
ThePirate
4 New Member
I've stripped out most of the unnecessary stuff and placed the needed files at the following location http://www.global-plus.co.uk/menuTest/index.php

As you can see it works fine in IE (apart from the alignment which I messed up when removing stuff) but doesn't work in FF.

The html code is generated in the following PHP function.

[PHP]

function menu() {

print"<li><a href='tribe_main.php'>HOME</a></li>";
print"<li><a href='tribe_vcs.php'>VCS</a></li>";
print"<ul>";
print"<li><a href='tribe_vcs.php'>SEARCH</a></li>";
print"<li><a href='tribe_vcs_add.php'>ADD CLAIM</a></li>";
print"<li><a href='tribe_vcs_my.php'>MY CLAIMS</a></li>";
print"<li><a href='tribe_vcs_player_claim.php'>MASS CLAIMS</a></li>";
print"<li><a href='tribe_vcs_mass.php'>MASS LOGIN</a></li>";
print"</ul>";
print"<li><a href='tribe_stats.php'>STATISTICS</a></li>";
print"<ul>";
print"<li><a href='tribe_stats.php'>TOTALS</a></li>";
print"<li><a href='tribe_stats2.php'>AVERAGES</a></li>";
print"<li><a href='tribe_stats3.php'>CAPTURES</a></li>";
print"<li><a href='tribe_stats4.php'>LOSSES</a></li>";
print"</ul>";
print"<li><a href='tribe_attack.php'>ATTACK TIMER</a></li>";
print"<li><a href='tribe_player_pos.php'>VILLAGE LISTS</a></li>";
print"<li><a href='tribe_mailing_list.php'>MAILING LIST</a></li>";
print"<ul>";
print"<li><a href='tribe_mailing_list.php'>TRIBE MAIL</a></li>";
print"<li><a href='tribe_mail_cl.php'>CL MAIL</a></li>";
print"</ul>";
print"<li><a href='tribe_hc.php'>HIGH COUNCIL</a></li>";
print"<ul>";
print"<li><a href='tribe_hc.php'>CL LISTS</a></li>";
print"<li><a href='tribe_hc_change.php'>CHANGE CL'S</a></li>";
print"</ul>";
}

[/PHP]
Dec 11 '07 #5
drhowarddrfine
7,435 Recognized Expert Expert
The problem, as always, is IE, not Firefox.

You are not using a doctype, which puts IE into 'quirks mode'. If you have been using IE as your test browser, then you've been designing to a bug. See the article about doctypes under Howtos at the top and use html4.01 strict.

Then validate your html and css for your list of errors there.

Never, ever use IE as an initial test. All versions of IE are 10 years behind web standards and buggy. Always use a modern browser like Firefox, Opera or Safari to make sure your markup displays how you want it. Then we can adjust for IEs quirks and bugs.
Dec 11 '07 #6
ThePirate
4 New Member
I keep telling my brother to use FF not IE but he just doesn't seem to listen. I've told him about Firebug and IETab extensions for FF and he still doesn't seem to listen. The other bug that he asked me to fix was why his tables weren't centered in FF when they were in IE and surprise surprise it was IEs fault.

I will try what you have said and get back to you. Thanks for the help.
Dec 11 '07 #7
drhowarddrfine
7,435 Recognized Expert Expert
He will never get IE to attempt to perform like modern browsers without a proper doctype. Until then, it's often a futile effort and I usually won't bother until that's been added.
Dec 11 '07 #8
drhowarddrfine
7,435 Recognized Expert Expert
This should fix some of those problems but it still needs some work.
[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<link href="../config/style.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../config/menu.css">
<title></title>
</head>
<body>
<br>
<b>Warning</b>: session_start() [<a href=
'function.session-start'>function.session-start</a>]: Cannot send
session cache limiter - headers already sent (output started at
/home/cptjack/public_html/menuTest/index.php:4) in
<b>/home/cptjack/public_html/menuTest/index.php</b> on line

<b>4</b><br>
<script type="text/javascript" src="../config/menu.js">
</script>
<table border="0" align="center" width="850" cellpadding="0"
cellspacing="0">
<tr align="center">
<td align="center"><img src="../images/header.gif" alt=
"XXXXXXXX"></td>
</tr>
<tr align="center">
<td background="../images/2ndheader.jpg" height="117" width="850"
align="left">
<table border="0" align="center" width="100%" cellpadding="0"
cellspacing="0">
<tr>
<td rowspan="2" width="190" align="center" height="110"><img src=
'../images/snob_ani.gif' alt="XXXXXXXX"></td>
<td colspan="2" height="70">
<div id="menu"></div>
</td>
</tr>

<tr>
<td valign="bottom" align="left"></td>
</tr>
</table>
</td>
</tr>
<tr align="center">
<td background="../images/content_bg.gif" width="850" height="10"
valign="top"></td>
</tr>
<tr align="center">
<td background="../images/content_bg.gif" width="850" valign="top">
<table border="0" align="center" width="100%" cellpadding="0"
cellspacing="0">
<tr align="center">
<td width="30">&nbsp;</td>
<td width="140" align="center" valign="top">
<ul id="verticalmenu" class="glossymenu">
<li><a href='tribe_main.php'>HOME</a></li>

<li><a href='tribe_vcs.php'>VCS</a></li>
<li style="list-style: none">
<ul>
<li><a href='tribe_vcs.php'>SEARCH</a></li>
<li><a href='tribe_vcs_add.php'>ADD CLAIM</a></li>
<li><a href='tribe_vcs_my.php'>MY CLAIMS</a></li>
<li><a href='tribe_vcs_player_claim.php'>MASS CLAIMS</a></li>
<li><a href='tribe_vcs_mass.php'>MASS LOGIN</a></li>
</ul>
</li>
<li><a href='tribe_stats.php'>STATISTICS</a></li>

<li style="list-style: none">
<ul>
<li><a href='tribe_stats.php'>TOTALS</a></li>
<li><a href='tribe_stats2.php'>AVERAGES</a></li>
<li><a href='tribe_stats3.php'>CAPTURES</a></li>
<li><a href='tribe_stats4.php'>LOSSES</a></li>
</ul>
</li>
<li><a href='tribe_attack.php'>ATTACK TIMER</a></li>
<li><a href='tribe_player_pos.php'>VILLAGE LISTS</a></li>
<li><a href='tribe_mailing_list.php'>MAILING LIST</a></li>

<li style="list-style: none">
<ul>
<li><a href='tribe_mailing_list.php'>TRIBE MAIL</a></li>
<li><a href='tribe_mail_cl.php'>CL MAIL</a></li>
</ul>
</li>
<li><a href='tribe_hc.php'>HIGH COUNCIL</a></li>
<li style="list-style: none">
<ul>
<li><a href='tribe_hc.php'>CL LISTS</a></li>
<li><a href='tribe_hc_change.php'>CHANGE CL'S</a></li>
</ul>

</li>
</ul>
</td>
<td width="42">&nbsp;</td>
<td valign="top">
<table border="0" align="center" width="100%" cellpadding="0"
cellspacing="0">
<tr>
<td><br>
<br></td>
</tr>
</table>
</td>
<td width="28">&nbsp;</td>
</tr>
</table>
</td>
</tr>

<tr align="center">
<td background="../images/bottomline.jpg" height="12" width="850">
</td>
</tr>
<tr align="center">
<td background="../images/content_blank.gif" height="70" width=
"850"></td>
</tr>
<tr align="center">
<td background="../images/footer_bg.jpg" height="97" width="850">
<div id="webactive"></div>
<table border="0" align="center" width="100%" cellpadding="0"
cellspacing="0">
<tr>
<td align="center"></td>
</tr>
</table>
</td>
</tr>

</table>
</body>
</html>[/HTML]
Dec 11 '07 #9

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

Similar topics

2
3828
by: Nils Weisensee | last post by:
Hello! For some reason, Internet Explorer is displaying one CSS-layer on my website http://home.arcor.de/nilsweisensee/links.html slightly differently than Firefox, Opera, Konqueror and Safari...
1
2816
by: Bill H | last post by:
I run a dbms application that interfaces with the web. This module creates a frames page with two frames ('main' and 'mwinfoframe'). All communication with the dbms is routed through the...
3
10649
by: Michael Schuerig | last post by:
I'm trying to use the right mouse button to open a popup on a specific element. The popup is triggered by a mouseup event. However, on mousedown the standard context menu opens. To get around this,...
2
1961
by: ouech | last post by:
hi, i finally tryied with a popup menu but i have a problem. i popup it with TrackMenuPopup and i create it from a ressource. but it doesn't look as it should. i d'ont have the names of the...
2
1832
by: SamSpade | last post by:
I use to get popup events when I checked out the menu coding. That was a while ago. Something I did in the interim must have suppressed those events because I just noticed I don't get them any...
11
7319
by: Alex.Svetos | last post by:
Hello, I'm trying to get a popup to keep focus when it is re-clicked. The script below is supposed to produce this exact behaviour, however it doesn't work, at least on firefox 1.0.7 and moz...
1
1116
by: Eirik Eldorsen | last post by:
I've found a bug on the menu control when using Firefox. Where should i report the bug? The bug appears if you click on an level-1 item (horisontal menu), and moves the mousecursor to the popup...
9
7853
by: john | last post by:
In Paradox I was able to create popup menu's in which some of the items had popup menu's themselves. I've looked for threads on popup menu's and access but I can't find how to make a simple popup...
3
6810
by: atn2002 | last post by:
I'm trying to create a control which when the mouse button gets pressed on one div an absolute positioned div pops up in place of the cursor. From there the cursor should interact with the dialog...
0
7007
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
7220
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
7386
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...
0
5468
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,...
1
4918
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...
0
4599
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...
0
3090
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
664
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
295
bsmnconsultancy
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...

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.