Any simple javascript to show an image when mouse over?

K

kelvin

Hi,

I would like to have a very simple code to show an image when the
mouse is hovered over a link.
some codes in HTML like
<A onmouseover="showimage('./user/image/vg001.gif')"
onmouseout="hideimage()" href="./user/image/vg001.gif" target="_blank"
<IMG height=116 src="./user/image/vg001th.gif" width=175 border=1 ></
A>

I make a search and found a lot of complicated javascripts.
Can anyone give me a simple sample?

Thank you a lot,

Best regards,
Kelvin
 
A

Adrienne Boswell

Hi,

I would like to have a very simple code to show an image when the
mouse is hovered over a link.
some codes in HTML like
<A onmouseover="showimage('./user/image/vg001.gif')"
onmouseout="hideimage()" href="./user/image/vg001.gif" target="_blank"
A>

I make a search and found a lot of complicated javascripts.
Can anyone give me a simple sample?

Thank you a lot,

Best regards,
Kelvin

Why bother with javascript in the first place? CSS is the way to go.
Oh, and please don't use target="_blank", it's very annoying and breaks
the back button.
 
K

kelvin

Hi,
Why bother with javascript in the first place? CSS is the way to go.
It is a great new I have heard. Can anyone tell me how to do it (show
an image when mouse is over a link) by css or any simple way for I am
a newbie at HTML/CSS design?

Thank you a lot,

Best regards,
Kelvin

Gazing into my crystal ball I observed kelvin <[email protected]>
writing in






Why bother with javascript in the first place? CSS is the way to go.
Oh, and please don't use target="_blank", it's very annoying and breaks
the back button.
Thank you a lot for this comments. I will remove them.
 
A

Adrienne Boswell

Gazing into my crystal ball I observed kelvin <[email protected]>
writing in
First, don't top post...
Second, don't my put response to the top and make ME at top poster!
Posting fixed...
Thank you a lot for this comments. I will remove them.

That's great! Another convert! Yippee!
It is a great new I have heard. Can anyone tell me how to do it (show
an image when mouse is over a link) by css or any simple way for I am
a newbie at HTML/CSS design?

I suggest you read some HTML and CSS tutorials, but here's something
quick and dirty:

<style type="text/css">
/* sets common properties for a elements */
a {background-repeat: none; background-position: left; padding-left:
16px;}
/* sets the different states for the a element */
a:link {background-image: url(linkimg.png); }
a:visited {background-image: url(visitedimg.png);}
a:hover {background-image: url(hoverimg.png); }
a:active {background-image: url(activeimg.png); }
</style>
 

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,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top