Help - Search - Members - Calendar
Full Version: HTML javascript
HTMLHelp Forums > Programming > Client-side Scripting
Roosevelt28
this source code shows text in a onMouseOver event

<html>
<head>
</head>
<script type="text/javascript">
function show(txt)
{
document.getElementById("show1").innerHTML=txt
}
</script>
<body>
<img src="pic\untitled-1.jpg" usemap="#planet" style="float:left">
<map id="planet" name="planet">
<area shape="circle" coords="576,146,6" alt="pluto" nohref onMouseOver="show(' SOME TEXT DESCRIBING PLUTO')" onMouseOut="show(' ')">
<area shape="circle" coords="503,162,18" alt="neptune" nohref>
<area shape="circle" coords="400,171,22" alt="uranus" nohref>
<area shape="circle" coords="318,187,24" alt="saturn" nohref>
<area shape="circle" coords="258,188,45" alt="jupiter" nohref>
<area shape="circle" coords="197,194,13" alt="mars" nohref>
<area shape="circle" coords="151,198,15" alt="earth" nohref>
<area shape="circle" coords="113,201,18" alt="venus" nohref>
<area shape="circle" coords="75,211,8" alt="mercury" nohref>
<area shape="poly" coords="0,70,28,144,38,193,28,248,0,277" alt="sun" nohref>
</map>
<p Id="show1"></p>
</body>
</html>

Question is:
how can I display an image rather than displaying a TEXT?

you can e-mail me at pios05@yahoo.com
Roosevelt28
I got the answer to my question LOL
if anyone interested to know how feel free to ask..
willing to help here.
Darin McGrew
So what did you figure out?
Roosevelt28
hmm just wondering.. what do you do for living?

hmm this is how you do it...

this is for the head section:

<script type="text/javascript">
function gettip(image)
{
document.getElementById('show2').innerHTML="<img src='" + image + "'height=100 width=100 />"
}
function reset()
{
document.getElementById('show2').innerHTML=" "
}
</script>

this is for the body section: IMAGE MAP

<img src="pic\untitled-1.jpg" usemap="#planet" style="float:left;margin-top:7%">
<map id="planet" name="planet">
<area shape="circle" coords="576,146,6" alt="pluto" nohref onmouseover="gettip(' s.jpg ')" onMouseOut="reset();show(' ')">

-----------


<p id="show2"></p>

hope you understand biggrin.gif

if you got a question, anything.. I'll try my best to help...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.