473,671 Members | 2,224 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Firefox doesn't process onmousemove

Hi.

Please take a look at this page:
http://tinyurl.com/s2l8w

In IE6, putting the mouse on each of the two items highlights the word
in a blue (different image) and shows a tool tip. In Firefox(1.5.0.6 ),
nothing shows when mouse goes over it. Please view the source of that
simple page (with some JavaScript) to see if you know how I can get
this to look in Firefox like it does in IE?

Thanks.

Sep 5 '06 #1
7 6457
Please also let me know if there is another newsgroup that I should
post this sort of question to. Thanks.

80********@vide otron.ca wrote:
Hi.

Please take a look at this page:
http://tinyurl.com/s2l8w

In IE6, putting the mouse on each of the two items highlights the word
in a blue (different image) and shows a tool tip. In Firefox(1.5.0.6 ),
nothing shows when mouse goes over it. Please view the source of that
simple page (with some JavaScript) to see if you know how I can get
this to look in Firefox like it does in IE?

Thanks.
Sep 5 '06 #2
80********@vide otron.ca said the following on 9/4/2006 9:33 PM:
Hi.

Please take a look at this page:
http://tinyurl.com/s2l8w

In IE6, putting the mouse on each of the two items highlights the word
in a blue (different image) and shows a tool tip. In Firefox(1.5.0.6 ),
nothing shows when mouse goes over it. Please view the source of that
simple page (with some JavaScript) to see if you know how I can get
this to look in Firefox like it does in IE?
The problem is that your script is written for IE/NN4 era browsers using
document.layers and document.all. The only reason it even works in IE is
that it still supports document.all and the test for it. Firefox has
limited supported for document.all but it will fail on an
if(document.all ) test. Although I personally don't see any reason at all
for using either one.

You use the images collection in the imgoff function but for some reason
you use document.layers/document.all in the imgon function.

I also don't see why you are having so many different function calls for
a simple rollover effect.

function swapImage(imgRe f,newSource){
imgRef.src = newSource;
}

And call it as such:

<img src="originalIm age.jpg"
onmouseover="sw apImage(this,'n ewImageSrc.jpg' )"
onmouseout="swa pImage(this,'or iginalImage.jpg ')"
>
The problem with the approach you have now is that when there are many
images on the page, your imgoff function will have to loop through all
the images and set them when it doesn't need to. The only image that
won't be in a default state is the one that has the mouse over it. When
you mouseout, you change it back.
--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Sep 5 '06 #3
Hi. And thanks for your response.

I just copied that as I was learning many years ago. Time to revise.

So I just have this code now but IE gives script errors when I put my
mouse over the bitmaps. What did I miss:

<HTML>
<HEAD>
<script language="JavaS cript" type="text/JavaScript">
<!--
function swapImage(imgRe f,newSource){
imgRef.src = newSource;
}
// -->
</script>
<TITLE>Sample </TITLE>
</HEAD>
<BODY bgcolor="Black" ><font size="-1"><BR></font>
<table border="0">
<tr>
<td><img src="images/home.jpg" width=80 height=35 alt="Main Page"
border="0"
onmouseover="Sw apImage(this,'i mages/homeon.jpg'),wi ndow.status='Ma in
Page'" onmouseout="Swa pImage(this,'im ages/home.jpg'),
window.status=' '"></td>
<td><img src="images/arcade.jpg" width=100 height=35 alt="Classic
Arcade Machines" border="0"
onmouseover="Sw apImage(this,'i mages/arcadeon.jpg'), window.status=' Classic
Arcade Machines'"
onmouseout="Swa pImage(this,'im ages/arcade.jpg'),wi ndow.status=''" ></td>
</tr>
</table>
</BODY>
</HTML>
Thanks.
Randy Webb wrote:
80********@vide otron.ca said the following on 9/4/2006 9:33 PM:
Hi.

Please take a look at this page:
http://tinyurl.com/s2l8w

In IE6, putting the mouse on each of the two items highlights the word
in a blue (different image) and shows a tool tip. In Firefox(1.5.0.6 ),
nothing shows when mouse goes over it. Please view the source of that
simple page (with some JavaScript) to see if you know how I can get
this to look in Firefox like it does in IE?

The problem is that your script is written for IE/NN4 era browsers using
document.layers and document.all. The only reason it even works in IE is
that it still supports document.all and the test for it. Firefox has
limited supported for document.all but it will fail on an
if(document.all ) test. Although I personally don't see any reason at all
for using either one.

You use the images collection in the imgoff function but for some reason
you use document.layers/document.all in the imgon function.

I also don't see why you are having so many different function calls for
a simple rollover effect.

function swapImage(imgRe f,newSource){
imgRef.src = newSource;
}

And call it as such:

<img src="originalIm age.jpg"
onmouseover="sw apImage(this,'n ewImageSrc.jpg' )"
onmouseout="swa pImage(this,'or iginalImage.jpg ')"
>

The problem with the approach you have now is that when there are many
images on the page, your imgoff function will have to loop through all
the images and set them when it doesn't need to. The only image that
won't be in a default state is the one that has the mouse over it. When
you mouseout, you change it back.
--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Sep 5 '06 #4
Doh, ok, I capitalized Swap by mistake. Works now.
So now I will work on what do I do to keep the rollover image on when I
click on an item (which eventually takes me to a html page)?
Onclick....

Thanks.

80s.arc...@vide otron.ca wrote:
Hi. And thanks for your response.

I just copied that as I was learning many years ago. Time to revise.

So I just have this code now but IE gives script errors when I put my
mouse over the bitmaps. What did I miss:

<HTML>
<HEAD>
<script language="JavaS cript" type="text/JavaScript">
<!--
function swapImage(imgRe f,newSource){
imgRef.src = newSource;
}
// -->
</script>
<TITLE>Sample </TITLE>
</HEAD>
<BODY bgcolor="Black" ><font size="-1"><BR></font>
<table border="0">
<tr>
<td><img src="images/home.jpg" width=80 height=35 alt="Main Page"
border="0"
onmouseover="Sw apImage(this,'i mages/homeon.jpg'),wi ndow.status='Ma in
Page'" onmouseout="Swa pImage(this,'im ages/home.jpg'),
window.status=' '"></td>
<td><img src="images/arcade.jpg" width=100 height=35 alt="Classic
Arcade Machines" border="0"
onmouseover="Sw apImage(this,'i mages/arcadeon.jpg'), window.status=' Classic
Arcade Machines'"
onmouseout="Swa pImage(this,'im ages/arcade.jpg'),wi ndow.status=''" ></td>
</tr>
</table>
</BODY>
</HTML>
Thanks.
Randy Webb wrote:
80********@vide otron.ca said the following on 9/4/2006 9:33 PM:
Hi.
>
Please take a look at this page:
http://tinyurl.com/s2l8w
>
In IE6, putting the mouse on each of the two items highlights the word
in a blue (different image) and shows a tool tip. In Firefox(1.5.0.6 ),
nothing shows when mouse goes over it. Please view the source of that
simple page (with some JavaScript) to see if you know how I can get
this to look in Firefox like it does in IE?
The problem is that your script is written for IE/NN4 era browsers using
document.layers and document.all. The only reason it even works in IE is
that it still supports document.all and the test for it. Firefox has
limited supported for document.all but it will fail on an
if(document.all ) test. Although I personally don't see any reason at all
for using either one.

You use the images collection in the imgoff function but for some reason
you use document.layers/document.all in the imgon function.

I also don't see why you are having so many different function calls for
a simple rollover effect.

function swapImage(imgRe f,newSource){
imgRef.src = newSource;
}

And call it as such:

<img src="originalIm age.jpg"
onmouseover="sw apImage(this,'n ewImageSrc.jpg' )"
onmouseout="swa pImage(this,'or iginalImage.jpg ')"
>
The problem with the approach you have now is that when there are many
images on the page, your imgoff function will have to loop through all
the images and set them when it doesn't need to. The only image that
won't be in a default state is the one that has the mouse over it. When
you mouseout, you change it back.
--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Sep 5 '06 #5
80********@vide otron.ca said the following on 9/4/2006 11:34 PM:
Doh, ok, I capitalized Swap by mistake. Works now.
So now I will work on what do I do to keep the rollover image on when I
click on an item (which eventually takes me to a html page)?
Onclick....
If you are navigating away from the page, then it won't matter will it?

onclick="thisCl icked(this,'cli ckedImage.jpg') "

function thisClicked(ele mClicked,newSrc ){
elemClicked.onm ouseover=null;
elemClicked.onm ouseout=null;
elemClicked.src = newSrc;
}

That will remove the onmouseover and onmouseout event handlers from the
image so that mousing over them won't change them anymore.

Still not sure what the point of making an image change when navigating
away though.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Sep 5 '06 #6
Oh, let me explain more. This is the top page of a simple frame based
page. So click on those items will change the bottom frame. Hence,
when click on the Arcade item, I would put a new frame at the bottom
and I wanted the Arcade item image to remain to the 'on' one. At this
point, moving my mouse over the Home would make it highlight but moving
the mouse over the Arcade would do nothing as it is on that frame
already. Clicking on Home would then highlight Home permanently with
the 'on' image and undo the Arcade 'on' image. Thanks.

Randy Webb wrote:
80********@vide otron.ca said the following on 9/4/2006 11:34 PM:
Doh, ok, I capitalized Swap by mistake. Works now.
So now I will work on what do I do to keep the rollover image on when I
click on an item (which eventually takes me to a html page)?
Onclick....

If you are navigating away from the page, then it won't matter will it?

onclick="thisCl icked(this,'cli ckedImage.jpg') "

function thisClicked(ele mClicked,newSrc ){
elemClicked.onm ouseover=null;
elemClicked.onm ouseout=null;
elemClicked.src = newSrc;
}

That will remove the onmouseover and onmouseout event handlers from the
image so that mousing over them won't change them anymore.

Still not sure what the point of making an image change when navigating
away though.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Sep 5 '06 #7
80********@vide otron.ca said the following on 9/4/2006 11:57 PM:
Oh, let me explain more. This is the top page of a simple frame based
page. So click on those items will change the bottom frame. Hence,
when click on the Arcade item, I would put a new frame at the bottom
and I wanted the Arcade item image to remain to the 'on' one. At this
point, moving my mouse over the Home would make it highlight but moving
the mouse over the Arcade would do nothing as it is on that frame
already. Clicking on Home would then highlight Home permanently with
the 'on' image and undo the Arcade 'on' image. Thanks.
The best that you could do would be to try to set a flag when navigation
happens and then check that flag onmouse* to see whether to trigger the
rollover effect.

onclick - change the image, reset all others, set a flag variable.
onmouseover - check the variable and act.

The flag variable could be set to the ID/NAME of the image that got
clicked. If the current mouseover is that image, then do nothing.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Sep 7 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2157
by: Schraalhans Keukenmeester | last post by:
I have no clue why below code (found it somewhere and altered it a wee bit to my needs) will run without problem in both IE and Mozilla FireFox 1.0 but in the latter it takes up close to 100% cpu. It does check for type of browser, and indeed all works fine apart from that ridiculous amount of cpu taken. If you want to see if it does so in your firefox/xp too, it's embedded in my homepage (www.westerterp.com) Can anyone explain why...
36
3551
by: Simon Wigzell | last post by:
I have the following in my webpage: <body onresize=CenterIt(); onMouseMove=mouseCheck(event);> CenterIt and mouseCheck are my own javascript functions. Works fine for IE and Opera, doesn't even go into the function for Firefox or Netscape. Is there a different way to assign functions to events that will be understood by "all" browsers? Thanks!
2
5360
by: AndrewW | last post by:
Hi I have an application that draws a selection rectangle over a map image. I can get it to work fine in IE and Opera, but not Firefox/Netscape. I've thrown the following small example together to illustrate the problem - the problem being that FF/NE initially draw my rectangle before the icon changes immediately to the black no-entry icon. Then, when I let go of the mouse, the rectangle continues drawing, but it
2
6016
Mobius Evalon
by: Mobius Evalon | last post by:
I'm trying to make this thing work in Firefox, because I know the client my game is on is pondering switching to Gecko (they're currently using something very similar to IE4 for browser windows launched in the client). This tooltip script works fine in IE, and the coordinates are apparently being read and changed in Firefox (I tossed in a div for debug), but I keep getting an "ev has no properties" error in Firefox and the tooltip div fails to...
6
9712
by: marss | last post by:
Hi, How can I define in Firefox whether the left mouse button is pressed when I move mouse over a html element? The documentation says that "e.button == 0 for standard 'click', usually left button" http://developer.mozilla.org/en/docs/DOM:event.button Tracing of mouse clicks or mousedown/mouseup events looks not reliable, because mouse can be pressed elsewhere out of the html element (even outside of the browser) and then move over the...
2
1667
by: Nathan Sokalski | last post by:
I have the following code which allows you to drag a div in IE, and have it then move back to it's natural position when you release the mouse button: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head><script type="text/javascript">var draggable=0;</script></head> <body> <div id="div1"
1
2587
by: jayvardhanpatil | last post by:
Hi All, I'm trying to position a dialog at my mouse position in firefox. I have one image control. On mouseover of image I call captureMouse() to get mouse position and after click on image I need to show the dialog with its topleft corner exactly from my mousepointer (On image) I did following work around It goes well with IE
1
1831
by: inteli | last post by:
Hey anybody can help me out wid this code..Its working well in IE but nt in firefox.The problem lies in offset,clientX,clientY part but I dnt know how to resolve it .. var zxcDockAry=new Array(); var zxcBdy,zxcObj,zxcWDone,zxcWDCnt,zxcXos,zxcYos,zxcTD,zxcDiv; var zxcDragDo=false; function zxcInit(){ zxcBdy = document.getElementsByTagName('BODY'); zxcdocks=zxcBdy.getElementsByTagName('TR'); for (zxc1=0;zxc1<zxcdocks.length;zxc1++){
0
8472
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8390
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8667
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7428
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6222
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4399
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2806
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2048
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1801
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.