Re: problems with mouseOver -- this is just plain stupid...

by Frances <ladywight(at)yahoo.com>

 Date:  Wed, 5 Dec 2001 05:06:43 -0800 (PST)
 To:  Mike Henden <mike.henden(at)xtra.co.nz>,
HWG techniques <hwg-techniques(at)mail.hwg.org>
 In-Reply-To: 
  todo: View Thread, Original
Your js is telling the browser to change image 7, but
you have not named the image.  All you need to do is
include the name attribute in the IMG tag:  i.e,
name="image7"

HTH
--- Mike Henden <mike.henden(at)xtra.co.nz> wrote:
> This is driving me NUTS...
> 
> I created a website for a client last year. Recently
> they asked me to 
> change a button image (the button in question used
> to read "events" 
> but now they would like it to read "what's new". Now
> I would consider 
> this to be a fairly simple operation, but it hasn't
> worked out that 
> way...
> 
> Basically I had to change the image names in the
> javascript preload 
> section thus:
> 
>    image7on = new Image();
>    image7on.src =
> "../images/buttons/8_whatsnew_on.JPG";
> 
>    image7off = new Image();
>    image7off.src =
> "../images/buttons/8_whatsnew_off.JPG";
> 
> and make similar changes in the body section as
> follows:
> 
> 	<tr><td width=NaN align=center><a
> href="whatsnew.html" 
> onMouseOver="changeImages('image7', 'image7on')" 
> onMouseOut="changeImages('image7',
> 'image7off')"><img 
> src="../images/buttons/8_whatsnew_off.JPG"
> width="120" height="29" 
> border="0"></a></td></tr>
> 
> but the damn thing won't run... The page loads fine
> (HTML seems OK), 
> the links works but the mouseOver event won't
> happen. Typing 
> "javascript:" in my trusty Netscape browser (doesn't
> work in IE 
> either) brings up the following error:
> 
>     document[changeImages.arguments[i]] has no
> properties.
>     JavaScript Error:
>     line 63:
> 
> The mouseOver function is described as follows:
> 
> }
> 
> 
> function changeImages() {
>    if (document.images) {
>      for (var i=0; i<changeImages.arguments.length;
> i+=2) {
>        document[changeImages.arguments[i]].src = 
> eval(changeImages.arguments[i+1] + ".src");
>      }
>    }
> }
> 
> which is used by all the buttons and runs correctly
> in all other 
> cases. Netscape tells me the affected line is this
> part of the 
> function:
> 
>   "document[changeImages.arguments[i]]" which it
> says "has no 
> properties (whatever that means -- seems to to me
> seeing as it works 
> in all other cases!)"
> 
> which I believe is a red herring -- I think the
> problem is the image 
> preload (though it looks the same as every other
> image preload on the 
> page) or the body HTML as that's what I changed!
> 
> I'm sure I'm missing something simple here (can't
> see the wood for 
> the trees), though it sure doesn't feel link it...
> 
> If anyone can help with this little puzzle the page
> can be found at:
> 
> http://japan.org.nz/christchurch/whatsnew.html
> 
> T. I. A.
> 
> MIKE
> 
> 
> 


=====


__________________________________________________
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA