Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onmouseover Java question.

Status
Not open for further replies.

aya

Programmer
Apr 10, 2002
3
AE
Hello.. i'm having some problems with this one.. code. I used this image rollover effect on a test page, and i got i to work, but.. i'm not sure where to put the toolbar text code [window.status='blahblah] in it. I've tried placing it where i thought it should go, but it wouldn't work. I know it's possible.. i've seen it done before.

the url for the test page is if you need to view the source.

Thank you.
 
I'm not sure where you're calling window.status, but you're not preloading the images used in the rollover properly. I suspect that you're seeing the browser write to the status bar instead as it's loading the images each time a mouseover/mouseout occurs, possibly overwriting your text. Try doing something like this instead:

<script language=&quot;javascript&quot;>
<!--
// preload the images
if (document.images) {
var buttonon=new Image();
var buttonoff=new Image();
buttonon.src=&quot; buttonoff.src=&quot;}

function changeImg(name,status)
{
// name is the image name, status should be &quot;on&quot; or &quot;off&quot; for a mouseover mouseout
// respectively
if (document.images)
document.images[name].src=eval(name + status + &quot;.src&quot;);
}
//-->
</script>
<body>
<a href=&quot; onMouseOver=&quot;changeImg('button','on');window.status='this should show up in the status bar...';return true;&quot; onMouseOut=&quot;changeImg('button','off');window.status='';return true;&quot;><img src=&quot; name=&quot;button&quot;></a>
</body>

By the way, I wouldn't generally expect an e-mail reply to a posted question. People that make the effort to answer questions in this forum do so for free. You're pushing it by asking them to type out an e-mail as well. Besides, you can flag a question for e-mail notification!

Regards,
[sig]<p>Russ<br><a href=mailto:bobbitts@hotmail.com>bobbitts@hotmail.com</a><br><a href= is in</a><br>[/sig]
 
Uhm, well thank you. I only asked for an e-mail reply because this site takes a while for me to get to, and lags a little bit. So, sorry. But thanks for your help. I wasn't aware of the &quot;e-mail notification&quot; option. I was in a hurry.

-- Aya
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top