Created
July 15, 2010 07:57
-
-
Save turugina/476642 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<html xmlns="http://www.w3.org/199/xhtml"> | |
<body> | |
<script src="http://www.google.com/jsapi"></script> | |
<script type="text/javascript"> | |
google.load("jquery", "1.3.1"); | |
</script> | |
<script type="text/javascript"> | |
$(function() { | |
var t1 = $("#test1"); | |
var t2 = $("#test2"); | |
t1.mousemove(function (e) { t2.show(); }); | |
t1.mouseout(function (e) { | |
var x = e.pageX; | |
var y = e.pageY; | |
var offset = t2.offset(); | |
if ( offset.left < x && x < offset.left+t2.width() && | |
offset.top < y && y < offset.top+t2.height() ) | |
; // t2.show(); // t2 still visible :) | |
else | |
t2.hide(); | |
}); | |
t2.mouseout(function(e){t2.hide();}); | |
t2.hide(); | |
}); | |
</script> | |
<style type="text/css"> | |
div { | |
border-style: solid; | |
border-width: 1px; | |
} | |
</style> | |
</body> | |
<div id="test3">TEXT3 | |
|<br /> | |
|<br /> | |
|<br /> | |
|<br /> | |
|<br /> | |
|<br /> | |
|<br /> | |
|<br /> | |
|<br /> | |
|<br /> | |
|<br /> | |
|<br /> | |
|<br /> | |
|<br /> | |
|<br /> | |
|<br /> | |
|<br /> | |
|<br /> | |
|<br /> | |
|<br /> | |
|<br /> | |
|<br /> | |
</div> | |
<div id="test1">TEXT1</div> | |
<div id="test2">TEXT2</div> | |
<div id="test4">TEXT4</div> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment