473,387 Members | 1,582 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.

My mouseover works in FF but not in IE

I cant get my mouse over to work in IE. It gives me the error 'document[..]' is null or not an object. However it works just fine in Firefox. Please help. Here's the javascript code

Expand|Select|Wrap|Line Numbers
  1. if (document.images)
  2.     {
  3.         var buttonon = new Image();
  4.         var buttonoff = new Image();
  5.         buttonon.src = '../images/buttonon.jpg';
  6.         buttonoff.src = '../images/buttonoff.jpg';
  7.     }
  8.  
  9.  
  10. function act(imgname)
  11.     {
  12.         if(document.images) document[imgname].src = eval(imgname + "on.src");
  13.     }
  14.  
  15. function inact(imgname)
  16.     {
  17.         if(document.images) document[imgname].src = eval(imgname + "off.src");
  18.     }
  19.  
  20.  
Dec 15 '10 #1

✓ answered by JKing

try using document.images[].src

2 1574
JKing
1,206 Expert 1GB
try using document.images[].src
Dec 15 '10 #2
YES!!! It works. Thank you so much. So simple and I was going crazy trying to figure out the more complicated explanations on the web.
Dec 15 '10 #3

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

Similar topics

3
by: graeme_smith77 | last post by:
Hi all, very new to web design in general and Javacript in particular. I found.... http://www.peterkerr.freeserve.co.uk/mouseover/html.html and used the mouseover example to add some changing...
2
by: Mitch | last post by:
I am hosting a web browser ctl in a container that implements the IDocHostUIHandler interface. I'm using this to control the context menu.This works fine. Then, I added a mouseover event to the...
11
by: Robert Baer | last post by:
The following passes the test as valid, and the mouseover for the six indicated areas also work. I need various areas to link to another page, including the six mentioned. However either the MAP...
26
by: Robert Baer | last post by:
The following passes the test as valid, and the mouseover for the six indicated areas also work. I need various areas to link to another page, including the six mentioned. However either the MAP...
1
by: Martin Pöpping | last post by:
Hello, I want to design a mouseover text using the following example: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="de"> <head>...
3
by: Annette Acquaire | last post by:
I have and image map with a dozen hotspot links on it that I'm trying to get to open a new image over existing one on mouseover of each COORD. The only thing I was able to do was swap image on...
10
by: jjamjatra | last post by:
I am struggling with a event model handling problem in Javascript that shows up only in Firefox. I have 2 little websites I'd like you to take a look at: ...
8
by: henryrhenryr | last post by:
I'm trying to log all links clicked. I'm just working this out so there may be some astoundingly bad methods. Please point out! It all works nicely though if I use mouseover events as the...
1
by: dave345 | last post by:
This javascript issue is in an app using C# / .Net 2.0 running on XP. First post, please mention if I mess up any conventions of this forum. I’ve got a mouseover event that only works properly...
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: 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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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,...

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.