Need a geek? Geeks to Go offers free, quality tech support -- in terms anyone can understand. Volunteers are waiting to help, friendly, technology experts who have knowledge to share, and enjoy helping others. Feel free to browse the site as a guest. However, you must log in to reply to existing topics, or to start a new topic of your own. Other benefits of joining include richer forum features, and removal of all advertising. Learn more in our Welcome Guide Infected? Malware and Spyware Cleaning Guide. What are you waiting for? Click here to join for free today!
 
Reply to this topicStart new topic
I seem to have forgotten how to use javascript..., easy question
kakaze
post 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?
Go to the top of the page
 
+Quote Post
Major Payne
post Jul 26 2009, 10:50 AM
Post #2


Trusted Techie
Group Icon
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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Time is now: 21st November 2009 - 07:49 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