MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » 一个关于ajax和div的有关问题

一个关于ajax和div的有关问题(2)

www.MyException.Cn  网友分享于:2015-08-27  浏览:363次

}

function calculateOffset(field, attr) {
var offset = 0;
while(field) {
offset += field[attr];
field = field.offsetParent;
}
return offset;
}

function clearData() {
var ind = dataTableBody.childNodes.length;
for (var i = ind - 1; i > = 0 ; i--) {
dataTableBody.removeChild(dataTableBody.childNodes[i]);
}
dataDiv.style.border = "none ";
}
</script>
</head>
<body>
<h1> Ajax Tooltip Example </h1>
<h3> Golf Courses </h3>
<table id= "courses " bgcolor= "#FFFAFA " border= "1 " cellspacing= "0 " cellpadding= "2 "/>
<tbody>
<tr> <td id= "1 " onmouseover= "getCourseData(this); " onmouseout= "clearData(); "> Augusta National </td> </tr>
<tr> <td id= "2 " onmouseover= "getCourseData(this); " onmouseout= "clearData(); "> Pinehurst No. 2 </td> </tr>
<tr> <td id= "3 " onmouseover= "getCourseData(this); " onmouseout= "clearData(); "> St. Andrews Links </td> </tr>
<tr> <td id= "4 " onmouseover= "getCourseData(this); " onmouseout= "clearData(); "> Baltusrol Golf Club </td> </tr>
</tbody>
</table>
<div style= "position:absolute; " id= "popup ">
<table id= "courseData " bgcolor= "#FFFAFA " border= "0 " cellspacing= "2 " cellpadding= "2 "/>
<tbody id= "courseDataBody "> </tbody>
</table>
</div>

</body>
</html>
没有贴全,少了java代码。
------解决方案--------------------
AJAX开发精要一书中有例子,例子网上有下

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有