Forum Moderators: open

Message Too Old, No Replies

Help with onMouseClick

Rollovers

         

Stardust

4:53 pm on Apr 21, 2004 (gmt 0)

10+ Year Member



I am a newbie trying to swap images onMouseClick.

Here's the page I am having trouble with:
[stargazing101.netfirms.com...]

OnMouseClick the image should swap to an image with the dove's wings in a downward position:
[stargazing101.netfirms.com...]

I used GoLive5 to generate this page.

Any advice?

Thanks Kate

Bernard Marx

5:13 pm on Apr 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi kate.

It works!

Remember that as soon as the button is clicked, the new page starts to load. Sometimes that may mean that the appearance change doesn't take place.

Have a go at implementing the image swap at the event:

onmousedown instead of onclick

Stardust

6:17 pm on Apr 21, 2004 (gmt 0)

10+ Year Member



Thanks for the prompt reply.

I am not having any luck with the onMouseDown event. It would be great if it did work because it would make the swap more consistent.

GoLive complains that it is looking for an object when I tried onMouseDown

Bernard Marx

8:24 pm on Apr 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's a standard operation in JavaScript, but GoLive has used highly generic (& heavy) code to implement it, in the way that these apps always do.

It's tempting to re-write the script, but I don't know how it would fit in with the rest of GoLive's ideas.

The problem might be here (a sample link & image from your source):

[color=blue]
<A HREF="" onMouseOver="act('loveo')"
onMouseOut="inact('loveo')"onMouseClick="fly('loveo')">
<IMG SRC="images/loveof.gif"
HEIGHT="45"
WIDTH="170"
NAME="loveo"
BORDER="0"
ALT="Love Offerings"></A>
[/color]

Notice that the 'onmouseout' attribute has elided with the 'onmouseclick'. There should be at least one space between them.

Just as important. There is no 'onmouseclick' attribute! Should be 'onclick'. Have a go at 'onmousedown' first.

Put that space where it should be, and try changing 'onmouseclick' to 'onmousedown'.

If you have search & replace, just search under:

"onMouseClick

and replace with

" onmousedown

That will hopefully do the trick.