Publisher HTML Code Fragment - onmouseover

D

DJ

I've added a html code fragment to a web page. I'm trying to do an image
rollover. I have been able to get the onmouseover to work with the
window.status and the alert box but not with replacing an image.

Are there problems with publisher 2002 with document.name.scr?

<a href="" onmouseover="document.logo.scr = 'altlogo.jpg'; return true">
<img src="Logo.jpg" NAME="logo" border="0" /></a>
Thanks
 
G

Geoffrey

DJ,
I'm not familiar with Publisher 2002, but in P2000 you need to add a
function script, preferably in the head of the HTML document. Pick up a full
script at one the DHTML sites like Dynamic Drive or BNB for instance. You
will find them in Google.

As an alternative you can use a false roll-over which also requires a
function script. You place the base image on the background and put the
roll-over image in a linked image file. The function sets the Alpha filter at
0 and the mouseover resets the filter to 100.

Cheers
 
D

David Bartosik

99% of Publisher's web publication customers aren't web programming
knowledgable so we don't get into code discussions. I'd recommend you start
by verifying your image path and name is accurate. Then post your code at a
coders forum to get it reviewed. As for Publisher, I don't suspect it would
code non DOM compliant code. Though I might be suspicious of it in the round
trip mode. Meaning if you are not using 2002 SP1 or better and generating the
filtered html output option, then I highly recommend you do so.
 
D

DJ

SPQR, it worked! Thank you!

Geoffrey said:
DJ,
I'm not familiar with Publisher 2002, but in P2000 you need to add a
function script, preferably in the head of the HTML document. Pick up a full
script at one the DHTML sites like Dynamic Drive or BNB for instance. You
will find them in Google.

As an alternative you can use a false roll-over which also requires a
function script. You place the base image on the background and put the
roll-over image in a linked image file. The function sets the Alpha filter at
0 and the mouseover resets the filter to 100.

Cheers
 
C

cdub

DJ,
I noticed a small type-o in your script, at ..."document.logo..." you typed
".scr", but probably meant ".src" I changed it, and it worked, just thought
I'd let you know that you were on the right track.
 
C

cdub

DJ,
I also added a bit so that the image will change back with onmouseout:

<a href="" onmouseover="document.logo.src = '/webimage/homebutnon.gif';
return true"
<a href=""onmouseout="document.logo.src='/webimage/homebutnoff.gif'">
<img src="/webimage/homebutnoff.gif" NAME="logo" border="0" /></a></a>

Just change the image names and src's as needed, it works great.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top