Images and hover

liunx

Guest
Hi. I'm not sure if HTML is how this can be done, but here's what I'd like to do. I have 5 images. They are all linked to dif pages. I would like on "hover" over a specific image, the name of that link (the name of the page) to be displayed in a box below. How can i do this?<br />
Maybe I'm not to good at explaining, so here's a link:<br />
<br />
<!-- m --><a class="postlink" href="http://www27.brinkster.com/minulescu/project">http://www27.brinkster.com/minulescu/project</a><!-- m --><!--content-->For starters, are you aware that that link of yours triggers a Download <!--more--> in some browsers?<br />
<br />
The reason is that the file is sent as mimetype "application/octet-stream".<br />
That is very very wrong...<br />
<br />
Please fix it (the easiest is probably to put .html at the end of the filename).<br />
<br />
Anyway, the easiest solution is to do this with CSS.<br />
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><br />
<html><br />
<head><br />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><br />
<meta http-equiv="Content-Script-Type" content="text/javascript"><br />
<meta http-equiv="Content-Style-Type" content="text/css"><br />
<title></title><br />
<style title="Default" media="screen" type="text/css"><br />
<br />
.imglinks a span {display:none;}<br />
.imglinks a:hover span {display:block; position:absolute; width:200px; top:200px; left:50%; margin:0 0 0 -100px;}<br />
<br />
</style><br />
</head><br />
<body><br />
<br />
<div class="imglinks"><br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/""><img 1><span> The name of page1</span></a><br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/""><img 2><span> The name of page2</span></a><br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/""><img 3><span> The name of page3</span></a><br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/""><img 4><span> The name of page4</span></a><br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/""><img 5><span> The name of page5</span></a><br />
</div><br />
<br />
</body><br />
</html><!--content-->Your example did not work for me in IE 5.5/Windows '98.<!--content-->Originally posted by gil davis <br />
Your example did not work for me in IE 5.5/Windows '98. <br />
<br />
Crap sorry, forgot about that IE bug. Thanks for pointing it out.<br />
<br />
The CSS should be like this<br />
<br />
.imglinks a span {display:none;}<br />
.imglinks a:hover {border-color:lime} /*IE bugfix*/<br />
.imglinks a:hover span {display:block; position:absolute; width:200px; top:200px; left:50%; margin:0 0 0 -100px;}<br />
<br />
If you don't add a border-color to the a:hover the poup fails to appear. And no, you don't actually need a border... just a color..<br />
Very logical isn't it :rolleyes: :D<br />
<br />
Anyway, that fixes it in IE 6 (and IE 5.5 IIRC, nag at me it if doesn't, don't feel like rebooting right now to try it out)<!--content-->You can also do:<br />
<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"page.html"><img src="imge.gif" onMouseOver="document.linkdescrip.style.display ='block';" onMouseOut="document.linkdescrip.style.display = 'none';"></a><br />
<br />
<span id="linkdescrip" name="linkdescrip" style="display:none;"><br />
This link is about...<br />
</span><br />
<br />
I'm not sure if that will work. I am not sure if the document.linkdescrip.style would refer to an ID or NAME attribute, so I added both.<!--content-->It would refer to the name, you use document.getElementById for IDs.<!--content-->thanks guys, it works perfect.<!--content-->
 
Back
Top