View Single Post
  #1 (permalink)  
Old January 7th, 2005, 04:47 AM
Adam H-W Adam H-W is offline
Friend of Wrox
Join Date: Jun 2003
Location: , , .
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default pre load images error

Hi there

I'm getting this error message:

'Object doesn't support this property or method' when I'm trying to use a preload script for some rollovers.

this is the javascript:

preloadImg = function(imgObj,imgSrc) {
    if (document.images) {
        eval(imgObj + '=new Image()');
        eval(imgObj + '.src="' + imgSrc + '"');

and later on in the page this is where I use it

<body onLoad="preloadImg('1','image_bin/1_over.gif','2','image_bin/2_over.gif','3','image_bin/'3_over.gif','4','image_bin/4_over.gif','5','image_bin/5_over.gif')">

not sure why it's happening - any help appreciated - thanks


Reply With Quote