mouseover swap image

T

Tom

I have been trying for a while to get a thumbnail image to come up when the
mouse comes over a section of text. It shows in the code the java script is
there but no image comes up. I have read how it is supposed to work but real
world it doesn't any expert know how to make this happen?
 
T

Trevor Lawrence

Tom said:
I have been trying for a while to get a thumbnail image to come up when the
mouse comes over a section of text. It shows in the code the java script
is
there but no image comes up. I have read how it is supposed to work but
real
world it doesn't any expert know how to make this happen?

NAP (Not a problem)

Please post the link to your page
 
T

Tom

The names in the middle of the page. I want it to pop up a thumbnail pic on
that person as the mouse rolls over that persons name. I put a button at the
end of the name that comes up as the mouse rolls over, but you have to double
click it and it opens in a different window. It has beat me down.
 
T

Trevor Lawrence

Tom said:
The names in the middle of the page. I want it to pop up a thumbnail pic
on
that person as the mouse rolls over that persons name. I put a button at
the
end of the name that comes up as the mouse rolls over, but you have to
double
click it and it opens in a different window. It has beat me down.

Tom.
Sorry I took so long to get back to you.

I started to amend the code to do what you want, but it seems (to my mind)
to use too much code. I have copied below some simpler code which I have
tested locally

When either of texts is moused over, an image appears. The position of this
image is determined by the style in <div id="layer1" >, which can be altered
to suit (using the width, height, left, top parameters).

When the text is clicked, the email program is invoked

I have shown examples of two names and images. My images are "images/11.jpg"
and "images/12.jpg" - change to suit your needs. Note the extra delimiters
(\) before the quote(') in the image tag e.g. '<img src =
\'images/11.jpg\'>'

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>This is the page</title>
<script language="JavaScript">
function hideit(elid) {
var e = document.getElementById(elid).style
e.display = (e.display != 'block') ? "block" : "none"
}
function setImage(id,txt) {
document.getElementById(id).innerHTML = txt
}
</script>
</head>
<body>
<div id="layer1"
style="position: absolute; display: none; z-index: 1;
width: 100px; height: 25px;
left: 200px; top: 30px;
border: solid black 1px;">
</div>
<p>
<a href="mailto:[email protected]"
onmouseover="hideit('layer1');setImage('layer1',
'<img src = \'images/11.jpg\'>');"
onmouseout="hideit('layer1');" >
Donna Hunnard</a> ...................... President / Manager / Escrow
Officer
</p>
<p>
<a href="mailto:[email protected]"
onmouseover="hideit('layer1');setImage('layer1',
'<img src = \'images/12.jpg\'>');"
onmouseout="hideit('layer1');" >
Rena Cargile</a> .......................... Assistant Manager / Escrow
Officer
</p>
</body>
</html>
 

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

Similar Threads

Mouseover ? 7
mouseover on text 11
Mouseover Images 1
swap image problem 5
Variable Home Page Image 6
font or image swap 3
Mouseover Image A to Change Image B! 3
Include Page and Image Swap 1

Top