0

i want to view image as tooltip of small image on mouseover on that so what is the code for that?using javascript how it can be done?

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by Walkere
0

i want to view image as tooltip of small image on mouseover on that so what is the code for that?using javascript how it can be done?

This does seem a bit out of place for the php forum... and I'm not sure what the code is to do it in Javascript.

However, you can do this with plain CSS.

Here's the basic premise:

You wrap the text you want to "mouse-over" in an anchor tag, without any href element. It helps to use a separate class of anchor tags, like "info".

You create a span element within that anchor tag. By default, the css for that span (a.info span) would be display:none.

When you mouse-over the anchor, you change the span's display to block (a.info:hover span {display:block}). You'd also want to give the span element a "position: relative" declaration, so that it appears on top of the text instead of running into the surrounding text.

Don't have a full tutorial handy, but that's the basic concept. It's pretty nifty when it's all done. Pure CSS, no Javascript required. It works fine with text, so I'd think that you could put an img tag inside the span tag and have it work just fine as well.

- Walkere

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.