Enjoy an ad free experience by logging in. Not a member yet?
Register .
10-03-2011, 02:41 AM
PM User |
#1
New to the CF scene
Join Date: Oct 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Image Tooltip over image
Hi,
Iīm searching a script which shows an image tooltip over an image. I donīt find something.
10-03-2011, 09:51 AM
PM User |
#2
Senior Coder
Join Date: Feb 2008
Location: Cebu City, Philippines
Posts: 1,752
Thanks: 65
Thanked 372 Times in 365 Posts
10-03-2011, 10:16 AM
PM User |
#3
Supreme Master coder!
Join Date: Jun 2002
Location: London, England
Posts: 17,033
Thanks: 197
Thanked 2,410 Times in 2,388 Posts
Quote:
Originally Posted by
Bubble
Hi,
Iīm searching a script which shows an image tooltip over an image. I donīt find something.
You have not tried very hard!
Google brings up many examples.
e.g.
http://coding.smashingmagazine.com/2...ipt-css-dhtml/
http://www.tamingthebeast.net/articl...ripts-uses.htm
It is your responsibility to die() if necessary….. - PHP Manual
__________________
All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.
Last edited by Philip M; 10-03-2011 at 10:20 AM ..
10-03-2011, 07:03 PM
PM User |
#4
New to the CF scene
Join Date: Oct 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
I found this one:
http://www.dynamicdrive.com/dynamici...ckytooltip.htm but i want one without a sticky option.
I donīt see an image tooltip over an image.
Where is the download link for the .js file? Also the tooltip is a bit transparent.
10-03-2011, 08:22 PM
PM User |
#5
Senior Coder
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 453 Times in 451 Posts
a guy who used to be a regular here posted a very handy script like this
here - you should scroll to the bottom of the thread to see the polished version
10-04-2011, 12:46 AM
PM User |
#6
New to the CF scene
Join Date: Oct 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
It shouldnīt be a "ballon" design- just a normal box. Is there really no script which simply shows an image tooltip over an image?
10-04-2011, 01:12 AM
PM User |
#7
Senior Coder
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 453 Times in 451 Posts
I guess most people if all they want is for a div to appear/disappear on mouseover/mouseout they just code it that way - it's about 5 lines of code, hardly worth making a separate script for. Did you see
this ?
10-04-2011, 01:33 AM
PM User |
#8
New to the CF scene
Join Date: Oct 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
The javascript was just an idea. So can you tell me that code?
10-04-2011, 01:41 AM
PM User |
#9
Senior Coder
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 453 Times in 451 Posts
I'm showing you the link, here:
http://xelawho.com/tooltips/
10-04-2011, 01:54 AM
PM User |
#10
New to the CF scene
Join Date: Oct 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Code:
<div id="mainbloc">
<img id="question" src="images/question_mark.png" "="" alt="">
<div style="display: none;" id="tooltipdiv" class="shadow">
<p>css tooltip with hidden div</p>
<img src="image1.jpg">
</div>
</div>
Ok thatīs the code. But how the css looks like. Iīm not very smart with that- sorry. :/
10-04-2011, 02:02 AM
PM User |
#11
Senior Coder
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 453 Times in 451 Posts
css is in the source code, at the top
10-04-2011, 02:31 AM
PM User |
#12
New to the CF scene
Join Date: Oct 2011
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Code:
<style type="text/CSS">
#tooltipdiv {
padding:0px;
display:none;
position:absolute;
margin-left:20px;
float:left;
font-family: sans-serif;
border:1px solid black;
}
#tooltipdiv2 {
padding:0px;
display:none;
float:left;
font-family: sans-serif;
border:1px solid black;
text-align:center;
margin: auto;
}
.shadow {
-moz-box-shadow: 3px 3px 4px #000;
-webkit-box-shadow: 3px 3px 4px #000;
box-shadow: 3px 3px 4px #000;
/* For IE 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=6, Direction=135, Color='#000000')";
/* For IE 5.5 - 7 */ filter: progid:DXImageTransform.Microsoft.Shadow(Strength=6, Direction=135, Color='#000000');
}
#cross {
float:right;
margin:5px;
cursor:pointer;
}
#question {
float:left;
overflow:auto;
}
#question2 {
float:left;
overflow:auto;
margin-right:10px;
cursor:pointer;
}
#tooltipdiv p {
font-family:sans-serif;
font-size:12px;
margin:2px 0px 0px 0px;
padding:2px 0px 2px 0px;
background-color:white;
text-align:center;
}
#mainbloc {
margin:0px 0px 0px 0px;
padding:0px;
}
</style>
<div id="mainbloc">
<img id="question" src="/pick.png"" alt="" />
<div id="tooltipdiv" class="shadow">
<p>css tooltip with hidden div</p>
<img src="/pic2.png">
</div>
</div>
So thats the code which i put in the top of my page. I can see the image, but there is no mouseover.
Donīt know what i am doing wrong...
10-04-2011, 02:32 PM
PM User |
#13
Senior Coder
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 453 Times in 451 Posts
here is a very simple version. this supposes that you have multiple images and you want their pop up images to be unique, but it will work for just one as well. all you need to do is name the pic you want to show base.jpg and the popup pic popup.jpg
and base2.jpg, popup2.jpg, etc...
Code:
<html>
<head>
</head>
<body>
<style>
.pops{
display:none;
position:absolute;
}
</style>
<div style="float:left">
<img id="pop" src="popup.jpg" class="pops">
<img src="base.jpg" onmouseover="showHide('block','pop')"; onmouseout="showHide('none','pop')">
</div>
<div style="float:right">
<img id="pop2" src="popup2.jpg" class="pops">
<img src="base2.jpg" onmouseover="showHide('block','pop2')"; onmouseout="showHide('none','pop2')">
</div>
<script type="text/javascript">
function showHide(style,img) {
document.getElementById(img).style.display=style;
}
</script>
</body>
</html>
Jump To Top of Thread
Thread Tools
Rate This Thread
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT +1. The time now is 02:04 PM .
Advertisement
Log in to turn off these ads.