<!doctype html>
<html>
<head>
<title></title>
<script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js” type=”text/javascript”></script>
<style type=”text/css”>
#divTips{
filter:alpha(opacity=30); /*IE滤镜,透明度50%*/
-moz-opacity:0.3; /*Firefox私有,透明度50%*/
opacity:0.3;/*其他,透明度50%*/
position: absolute;width: 600px; height: 400px;display:none;color:red;z-index:10;padding:10px;
}
</style>
<script type=”text/javascript”>
$(function () {
var $txtNote = $(“#txtNote”);
var $divTips = $(“#divTips”);
$txtNote.focus(function () {
//置焦点时隐藏
$divTips.hide();
}).blur(function () {
//离开时, 如果为空则显示,否则隐藏. 然后定位
$divTips.toggle($txtNote.val() == “”)
.css({
“left”: $txtNote.position().left,
“top” : $txtNote.position().top
});
});
$divTips.click(function () {
$txtNote.focus();
});










