My mouseover works in FF but not in IE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Radhika Raj
    New Member
    • Dec 2010
    • 2

    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

    Code:
    if (document.images)
    	{
    		var buttonon = new Image();
    		var buttonoff = new Image();
    		buttonon.src = '../images/buttonon.jpg';
    		buttonoff.src = '../images/buttonoff.jpg';
    	}
    			
    			
    function act(imgname)
    	{
    		if(document.images) document[imgname].src = eval(imgname + "on.src");
    	}
    	
    function inact(imgname)
    	{
    		if(document.images) document[imgname].src = eval(imgname + "off.src");
    	}
  • JKing
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    try using document.images[].src

    Comment

    • Radhika Raj
      New Member
      • Dec 2010
      • 2

      #3
      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.

      Comment

      Working...