Connecting Tech Pros Worldwide Forums | Help | Site Map

onclilck variable

Richard
Guest
 
Posts: n/a
#1: Jul 20 '05
http://1-large-world.com/stargate/map2.html

When you mouse over one of the chevrons, the main image changes.
What I'd like do next is to have an onclick instead of onmouseout.
So that a variable would tell the function which new area to go to.

For instance:
chevronclick=0 on load.
clicking at chevron 4 would set the variable to 4.
The proper url selected by the variable.

thanks.




The Plankmeister
Guest
 
Posts: n/a
#2: Jul 20 '05

re: onclilck variable


> For instance:[color=blue]
> chevronclick=0 on load.
> clicking at chevron 4 would set the variable to 4.
> The proper url selected by the variable.[/color]

I'm pretty sure that just declaring a global variable as the first line
inside your script, then setting it with an onclick would work... thus:

[snip]
var chevronclick = 0;
if(document.images) {
pics = new Array(12);
pics[1] = new Image();
pics[1].src = "main.gif";
[snip]

[snip]
<AREA SHAPE="CIRCLE" COORDS="110,60,-41" HREF="#"
onClick="chevronclick=4" onMouseOver="changer('img1',4)">
[snip]


I've not tested this but that should work.

Alternatively, why not just put the appropriate URL in the HREF? From what I
can see that would be an easier approach. But I'm not privy to all the facts
:)

HTH.

P.


Closed Thread