在<body>中任意处添加DIV,例如:
<div id="tip"
style
="position: absolute; display: none; border: 1px; border-style: solid;"
>
< TABLE id ="tipTable" border ="0" bgcolor ="#EEE9DF" >
< tr >
< th ></ th >
</ tr >
< TR >
< TD ></ TD >
</ TR >
< TR >
< TD ></ TD >
</ TR >
</ TABLE >
</ div >
< TABLE id ="tipTable" border ="0" bgcolor ="#EEE9DF" >
< tr >
< th ></ th >
</ tr >
< TR >
< TD ></ TD >
</ TR >
< TR >
< TD ></ TD >
</ TR >
</ TABLE >
</ div >
在标签里调用此JS:
function showDialog(url) {
var
e
=
window.event;
var posx = 0 ,posy = 0 ;
if (e.pageX || e.pageY){
posx = e.pageX;
posy = e.pageY;
}
else if (e.clientX || e.clientY){
if (document.documentElement.scrollTop){
posx = e.clientX + document.documentElement.scrollLeft;
posy = e.clientY + document.documentElement.scrollTop;
} else {
posx = e.clientX + document.body.scrollLeft;
posy = e.clientY + document.body.scrollTop;
}
}
document.all.tip.style.top = (posy + 10 ) + " px " ;
document.all.tip.style.left = (posx - 20 ) + " px " ;
document.all.tip.style.display = " block " ;
document.all.tipTable.rows[ 0 ].cells[ 0 ].innerHTML = " 请选择 " ; document.all.tipTable.rows[ 1 ].cells[ 0 ].innerHTML = " <input type='radio' name='type' value='新项目' οnclick='relocation(this)'>新项目</input> " ; document.all.tipTable.rows[ 2 ].cells[ 0 ].innerHTML = " <input type='radio' name='type' value='变更' οnclick='relocation(this)'>变更</input> " ;
}
var posx = 0 ,posy = 0 ;
if (e.pageX || e.pageY){
posx = e.pageX;
posy = e.pageY;
}
else if (e.clientX || e.clientY){
if (document.documentElement.scrollTop){
posx = e.clientX + document.documentElement.scrollLeft;
posy = e.clientY + document.documentElement.scrollTop;
} else {
posx = e.clientX + document.body.scrollLeft;
posy = e.clientY + document.body.scrollTop;
}
}
document.all.tip.style.top = (posy + 10 ) + " px " ;
document.all.tip.style.left = (posx - 20 ) + " px " ;
document.all.tip.style.display = " block " ;
document.all.tipTable.rows[ 0 ].cells[ 0 ].innerHTML = " 请选择 " ; document.all.tipTable.rows[ 1 ].cells[ 0 ].innerHTML = " <input type='radio' name='type' value='新项目' οnclick='relocation(this)'>新项目</input> " ; document.all.tipTable.rows[ 2 ].cells[ 0 ].innerHTML = " <input type='radio' name='type' value='变更' οnclick='relocation(this)'>变更</input> " ;
}