![]() |
pop up box
Hi. I am making a test page to see how to make a pop up box (div) that will appear when a the cursor is over other div and disappear when it is not over this div. The appearing is quite easy, just made it with css, when the div2 is hover div1 should be visible.
But the problem is how to determine when the cursor is not over this div. Of course it could be done with javascript: settinming a function for every 1 sec, to check the mouse position and calculate if it's over the div or not, but I think it's very bad method, I guess there should be something easier... Any ideas? |
<div onmouseover="javascript:alert('ello');"> boom! </div>
works |
no, I meant not alert...
something like a tooltip... will look for an example and post it here if I find |
DHTML JavaScript Tooltips
like this one, when you mouse your cursor over the photo. A personalized div with html in it.. not an alert box |
Oh - you also want to know the javascript neccesary to make the actual tooltipbox - I got you.
I'd check out DHTML JavaScript Tooltips haha, beat me to it. |
ok, I guess some code is needed here:
PHP Code:
|
Why don't you use JavaScript? It's a lot easier...
HTML Code:
<script type="text/javascript"> |
Another way, which is in my opinion nicer, is to use the jquery framework to produce tooltips.
Actually, I am going to write a tutorial / article on it now! Gareth |
try mootools tooltip .. ^__^
|
Quote:
So there is no way to detect the mouseout event only with css?? |
Quote:
CSS is to be used only for styling, and not for showing/hiding other elements. :-) |
No, you can detect the mouse, heres some code to get the position:
Code:
|
Check this out.
mootools demos - Tips Really easy. html Code:
javascript Code:
|
Thanks.
I definitely have to learn some javascript library like mootools or jQuery :) |
Quote:
this code not work at IE6+ Please help me , repair it:-D |
|
FF that work
but IE 6, it not work :'-(:'-(:'-( |
IE doesnt support :hover pseudo class on anything other than a link.
|
| All times are GMT. The time now is 01:50 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0