onclick and variables

R

Richard

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.
I know this is most likely handled in javascript, can it be done in html?
For instance:
chevronclick=0 on load.
clicking at chevron 4 would set the variable to 4.
The proper url selected by the variable.
I will also post this in the javascript group.

thanks.
 
R

rf

Richard said:
http://1-large-world.com/stargate/map2.html

When you mouse over one of the chevrons, the main image changes.

This looks very much like mystery meat navigation.
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.
I know this is most likely handled in javascript, can it be done in html?
For instance:
chevronclick=0 on load.
clicking at chevron 4 would set the variable to 4.
The proper url selected by the variable.

Er, why. Why not just use the built-in onclick handler provided by the <area
href=...> element? That is, after all, what an area element if for :)
I will also post this in the javascript group.

Crosspost next time. That way everybody gets to see all the responses.

Cheers
Richard.
 
R

Richard

rf wrote:>>

This looks very much like mystery meat navigation.
Er, why. Why not just use the built-in onclick handler provided by the
<area href=...> element? That is, after all, what an area element if for
:)

That's what I want to know. What is the proper syntax for doing it that way?
What I have tried results in an error. as with mouseover, it is expected to
find a script of some sort.
I've been searching on the web and have found no answers to that yet.
 
R

rf

Richard said:
rf wrote:>>



That's what I want to know. What is the proper syntax for doing it that way?
What I have tried results in an error. as with mouseover, it is expected to
find a script of some sort.
I've been searching on the web and have found no answers to that yet.

Hmmm. <AREA onmouseover="changer('img1',2)" shape=CIRCLE coords=69,347,-41
href="http://google.com/"> ?

Cheers
Richard.
 
R

Richard

Richard wrote:>>
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.
I know this is most likely handled in javascript, can it be done in html?
For instance:
chevronclick=0 on load.
clicking at chevron 4 would set the variable to 4.
The proper url selected by the variable.
I will also post this in the javascript group.


Figured it out I think.
<area................onClick="window.location='http://www.site.com'">
at least it works.
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top