JavaScript - OnMouseOver - Object has no properties

by "Doug Dossett" <hwg(at)igotnothin.com>

 Date:  Fri, 25 May 2001 14:23:57 -0700
 To:  hwg-techniques(at)hwg.org
  todo: View Thread, Original
Hello all,

I tried to avoid asking this, but for the life of me I can't seem to find 
a solution anywhere.

I have a graphic that upon mouseover, I want to change the 
graphic. This works, no problem.  In addition, upon mouseover, I 
want to change some text elsewhere on the page.  On other pages 
I've done something similar just by hidding content and making it 
visible using css and javascript.  For some reason on this project 
it's not working.  Example of what I'm trying:

Image link:

<a href="https://hwg.org/blah" onmouseover = 
"CC_Button(1,'/images/HomePage/button1sa.jpg', 
'rtQuote2')"><img name="1" src="https://hwg.org/blah.jpg"></a>

Text to be changed:

		<div id="rtQuote1" style="position: absolute; visibility: 
visible; width: auto; height: auto; padding: 10px;">"This is a short 
blurb.  We will need any additional text to fill this space."</div>
		<div id="rtQuote2" style="padding: 10px; position: 
absolute; width: auto; height: auto; visibility: hidden;">"This is 
descriptive text for button 1"</div>

Javascript to change image and text:

function CC_Button(name,picimage, newtext) {

document[name].src = picimage;
document.rtQuote1.visibility = "hidden";
document[newtext].visibility = "visible";

}

This is of course not at all cross browser compatable, but I would 
expect it to work in Netscape 4.x.  But instead I get the error: 
rtQuote1 has no properties.  I've tried changing the div to a span a 
p and an a, but it doesn't matter.  What am I missing?  How do I 
get rtQuote1 to have properties so I can hide it? 

The above code is trimmed down significantly, but is hopefully 
enough.  Any help, guidance, links or anything would be much 
appreciated. 

Regards,

Doug Dossett
MiscSites.com

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

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.