I seem to have forgotten how to use javascript..., easy question |
![]() ![]() |
I seem to have forgotten how to use javascript..., easy question |
Jul 26 2009, 06:54 AM
Post
#1
|
|
|
Member ![]() ![]() Posts: 17 OS: xp media centre |
Could aanyone help me out here with a javascript problem I'm having.
Ages ago I learned how to use javascript and never had any problems with it but I'm trying to make a clickable image right now and...I seem to have forgotten it all. What I've done looks like this: <html> <img src="australia.png" usemap="#isles"/> <map name="isles" id="isles"> <area shape="rect" coords="13,53,73,165" href="java script:clicked_on('MAD!');" title="Test" alt="Tested"/> </html> The shape is in the right place alright and is clickable but when I do nothing happens.... Is there some sort of activating javascript at the start you're meant to do? - The trouble I see here is I've got my script command nested in the middle of a bunch of otherwise normal html and I don't want this html taken to be bad javascript code. Can anyone point out the probally very obvious thing wrong? |
|
|
Jul 26 2009, 10:50 AM
Post
#2
|
|
![]() Trusted Techie Posts: 5,236 From: Now in a MEMA (Katrina) Cottage OS: Win XP/Vista Home Premium. Backup PC: Commodore 64 with 300 baud modem! |
This is an example of a proper image map:
CODE <div id="header_main"><!-- START Main Header --> <map name="header"> <area href="index.html" alt="HOME" title="HOME" shape="rect" coords= "24,97,167,130" /> <area href="games.html" alt="GAMES" title="GAMES" shape="rect" coords= "170,97,294,130" /> <area href="videos.html" alt="VIDEOS" title="VIDEOS" shape="rect" coords= "296,97,451,129" /> <area href="contact.html" alt="CONTACT" title="CONTACT" shape="rect" coords= "453,98,619,129" /> <area href="ideas.html" alt="IDEAS" title="IDEAS" shape="rect" coords= "621,97,783,130" /> <area href="donate.html" alt="DONATE" title="DONATE" shape="rect" coords= "785,97,979,130" /></map> <img id="header_top" src="images/header.png" title="Mouseover Description" alt="header" usemap="#header" /> </div><!-- END Main Header --> Another clickable image exaple: CODE <p><a href="URL path to external link" title="Mouseover Description"><img style="width: XXpx; height: YYpx; border: 0;" src="Path to image" alt="Text Description"></a></p> You can change the "p" tags to div tags and style as needed to make a nice div container for links. This post has been edited by Major Payne: Jul 26 2009, 10:51 AM |
|
|
![]() ![]() |
Similar Topics
| Topic Title | Replies / Views | Topic Information | |||||
|---|---|---|---|---|---|---|---|
![]() |
1 / 814 | 13th February 2007 - 05:55 AM jonfred123456 started - last by fleamailman |
|||||
![]() |
2 / 395 | 29th August 2009 - 08:56 AM superstar started - last by rshaffer61 |
|||||
![]() |
1 / 200 | 19th September 2009 - 05:44 AM LANCE_1313 started - last by LANCE_1313 |
|||||
![]() |
0 / 25 | 9th November 2009 - 06:15 PM imca28scia started - last by imca28scia |
|||||
|
Time is now: 21st November 2009 - 04:30 AM |
Advertisements do not imply our endorsement of that product or service. The forum is run by volunteers who donate their time and expertise. We make every attempt to ensure that the help and advice posted is accurate and will not cause harm to your computer. However, we do not guarantee that they are accurate and they are to be used at your own risk. All trademarks mentioned on this page are the property of their respective owners.
© Geeks to Go, Inc. | All Rights Reserved | Privacy Policy | Advertising