<script type="text/
javascript">
var popup_target;
var popup_mouseposX;
var popup_mouseposY;
// ----- popup_exit --
function popup_exit(str)
{
if(str == 'init'){
//document.getElementById("tableid").attachEvent("onclick",popup_exit);
document.getElementById("tableid").onclick = popup_exit;
return;
}
var element = document.getElementById('popup3');
element.style.visibility = 'hidden';
element.style.display = 'none';
}
// ----- popup_show --
function popup_show(id)
{
element = document.getElementById('popup'+id);
element.style.position = "absolute";
element.style.visibility = "visible";
element.style.display = "block";
element.style.left = (document.documentElement.scrollLeft+popup_mouseposX+10)+'px';
element.style.top = (document.documentElement.scrollTop +popup_mouseposY+10)+'px';
//document.getElementById("tableid").attachEvent("onclick",function(){popup_exit('init');});
document.getElementById("tableid").onclick = function(){popup_exit('init');}
}
// ----- popup_mousepos ---
function popup_mousepos(e)
{
var ie = navigator.appName == "Microsoft Internet Explorer";
popup_mouseposX = ie ? window.event.clientX : e.clientX;
popup_mouseposY = ie ? window.event.clientY : e.clientY;
}
// ----- Attach Events ----
//www.jb200.com
document.attachEvent('onmou
sedown', popup_mousepos);
</script>
<body>
<table id='tableid'>
<tr>
<td>example</td>
<td>example</td>
<td>example</td>
<td>example</td>
</tr>
<tr>
<td>example</td>
<td>example</td>
<td><a href="javascript:void(0)" onclick="popup_show(3)" >提示窗口</a></td>
<td>example</td>
</tr>
<tr>
<td>example</td>
<td>example</td>
<td>example</td>
<td>example</td>
</table>
<div class="sample_popup" id="popup3" style="visibility: hidden; display: none;">
这是提示窗口的正文区域,可以在这里填写任何内容。<br />
脚本学堂,欢迎大家的光临! <br/>
</div>
</body>