473,387 Members | 1,603 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,387 software developers and data experts.

Roll over menus not working for FF

I have an old code in a website which shows roll over menu on mouse over event. Now it is not working in FF, Chrome and Safari. only works in IE. Below is the code snippet

Expand|Select|Wrap|Line Numbers
  1.  
  2. // layerTest  class
  3. <div class=menu id=layerTest style="width: 47; height: 8; layer-background-color: #FFFFFF; border: 1px none #000000; background-color: #FFFFFF"></div>
  4.  
  5. // Below is the HTML tag for image to show the menu on mouse over function when the functions mentioned in the tag are called on mouseover or mousout event
  6.  
  7. <td  valign="bottom" width="75" height="15" >
  8. <a href="#" onMouseOut="timer(0);" onMouseOver="activateMenu(1,'tools',30,19); timer(1);MM_swapImgRestore();MM_swapImage('profile','','images/comp_btn_ov.gif',1)"><img src="images/comp_btn.gif"  border="0"  name="profile" width="75" height="19"></a>
  9. </td>
  10.  
  11. // Below is the defination of activateMenu function in javascript include page
  12.  
  13. function activateMenu(menuLayerRef, imageName, left, top) 
  14. {
  15.     var lightsout
  16.  
  17.         // I think problem is in a below mentioned line
  18.        var isDynamic = ( ((document.layers && document.layers['layerTest']) || (document.all && document.all['layerTest'])) && !isMacIE );
  19.  
  20.        // layerTest CLASS is define at the starting of this code
  21.  
  22.         if (isDynamic && activeMenu != menuLayerRef) {
  23.          if (activeMenu) hideMenu("menu" + activeMenu); 
  24.         menuID = "menu" + menuLayerRef;
  25.         activeMenu = menuLayerRef;
  26.  
  27.         if (isNS) {
  28.               document[menuID].left = getXCoord(imageName) + left;
  29.               document[menuID].top = getYCoord(imageName) + top;
  30.         } 
  31.         else {
  32.             document.all[menuID].style.pixelLeft = getXCoord(imageName) + left;
  33.             document.all[menuID].style.pixelTop = getYCoord(imageName) + top;
  34.         }
  35.         showMenu(menuID, left, top)
  36.     }
  37. }
  38.  
  39. function showMenu(layerID, left, top) {
  40.     eval(layerRef + '["' + layerID + '"]' + 
  41.     styleRef + '.visibility = "visible"');
  42. }
  43.  
  44.  
Mar 29 '10 #1
1 1445
acoder
16,027 Expert Mod 8TB
Instead of document.layers/document.all, use document.getElementById and forget the NS/IE branches. Use document.getElementById(menuID) to reference the element and don't forget the units when setting top/left.
Apr 29 '10 #2

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

Similar topics

4
by: Larry R Harrison Jr | last post by:
I have them working now, courtesy of the link given in the prior thread--the HVMenu over at Dynamic Drive myself. http://www.dynamicdrive.com I have them working as side-bar menus, not...
4
by: Ringo Langly | last post by:
Hi everyone, We're using an outside vendor to provide some content for our website, and they use the http_referer variable to verify their content is only viewed from subscribing customers. ...
2
by: Peter Sands | last post by:
Hi, I am testing out some restores to a stand-by server, by roll-forwading the logs. I have this setup. There is no user-exit, but logretain is on, for archive logging. I have 2 DB's on...
3
by: cefrancke | last post by:
The only reason I ask is that no one has made this subject clear or given a definitive answer. What I would like to do is, after turning off all the menus/tbars/etc using the startup options. ...
4
by: Karl Irvin | last post by:
I distribute an A 2000 app as a mde. On a few customers, my custom menus are overwritten. The top menu is generally there but the choices on the menus are gone or replaced by something else. ...
4
by: Bratislav Jevtic | last post by:
hi, we developed an application having server-side menus. however, I'm interested for: 1. some nice client side drop down menus. ideal solution would be something like windows menus in...
4
by: Tassie | last post by:
I have put javascript menus on some of the navigation buttons on my website - they are supposed to load on mouseover. Before I uploaded the site, they appeared to work. On all of the navigation...
4
by: clairelee0322 | last post by:
Hello guys again! I am a C++ beginner and I am working on another project.. It's called Dice Lab with Loops.. unforunately I don't even know how to start the program.... Don't blame me for not pay...
6
by: dbuchanan | last post by:
There are three parts to this 1.) How do I cascade menus? 2.) And, how do I cascade menus with a multi-select CheckBoxList?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
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
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.