|
|
| Welcome to the Mac Forums forums. Please read the FAQ if you have questions. Register to participate. |
|
|||||||
| TouchArcade.com - iPhone Game Reviews and News |
![]() |
|
|
Thread Tools | Search this Thread |
|
|
|
|
#1 |
|
macrumors member
|
Pop-up image when hovering html text/link
Hey all,
I have a page on my website with many machine names in a list. I thought it'd be nice upon hovering over a machine list item (not necessarily a link), that an image would pop-up showing you the machine. I want something like this: https://www.panic.com/fancy/buy.html Except, it'd be nice if it was a lot simpler. I don't need the fancy loading icons or the transitional effects. Also, it is a corporate website, and I don't know if they're in to paying 40 dollars for something they may not even use (it looks like the effect for FancyZoom is only for images, anyways). The website doesn't necessarily make money, but the company does. Does that exempt us from the fee? The site hardly gets hundreds of viewers, and is just showing the viewer what the company does. Can FancyZoom be modified to work on links instead of images? I digress. If anyone has a code or script (it'd be nice not having to use javascript though) for doing this sort of thing, it would be much appreciated. |
|
|
|
| Fromethius |
| View Public Profile |
| Find More Posts by Fromethius |
|
|
#2 |
|
macrumors 601
Join Date: Aug 2005
Location: Dayton, OH
|
You could actually achieve this with CSS alone.
HTML: HTML Code:
<p class="fancy">Some text with a link. <img src="image.jpg" alt="wow"></p> Code:
p.fancy img {
display: none;
}
p.fancy:hover img {
display: inline; /* or block */
}
As a note, the above won't work in IE as t doesn't support the hover portion on anything but links. Though, if links will be present then we can probably tweak the above. |
|
|
|
|
|
#3 |
|
macrumors 68000
Join Date: Jul 2006
|
CSS would be the simplest way, on the other hand like angelwatt said IE hates you...
![]() For that reason the code would be something like... Head tag: HTML Code:
<script type="text/javascript"> function showImage(imageVar) { document.getElementById(imageVar).style.display="block" } </script> Code:
<img src="image.gif" id="image1" style="display:none;" />
<a href="#" onMouseOver="showImage('image1')">text rollover</a>
You would probably also want to add a mouse out function so that when the mouse is no longer hover over the text the image hides...
__________________
TimeTable: The Freelancer's Tool |
|
|
|
|
|
#4 | |
|
Thread Starter
macrumors member
|
Quote:
|
|
|
|
|
| Fromethius |
| View Public Profile |
| Find More Posts by Fromethius |
|
|
#5 | ||
|
Thread Starter
macrumors member
|
Quote:
Quote:
Last edited by Fromethius : Aug 1, 2008 at 10:57 PM. |
||
|
|
|
| Fromethius |
| View Public Profile |
| Find More Posts by Fromethius |
|
|
#6 |
|
macrumors 601
Join Date: Aug 2005
Location: Dayton, OH
|
To give you a more specific solution we need to see the code that you're working with. Also, need to know the exact behavior you want, like where the image should pop-up in relation to the text. That's why we didn't give complete solutions, we needs the details.
|
|
|
|
|
|
#7 |
|
Thread Starter
macrumors member
|
|
|
|
|
| Fromethius |
| View Public Profile |
| Find More Posts by Fromethius |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|