2个回答
展开全部
<div id="a1" style=" position:absolute; z-index:2;"></div>
<table width="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><a herf="www.baidu.com" onmousemove="show(event,'http://www.baidu.com/img/baidu_logo.gif','www.baidu.com')"
onmouseout="hide(this)" >你好</a></td>
</tr>
</table>
<script>
function show(event,_this,mess) {
event = event || window.event;
var t1="<table cellspacing='1' cellpadding='10' style='border-color:#CCCCCC;background-color:#FFFFFF;font-
size:12px;border-style:solid; border-width:thin;text-align:center;'><tr><td><img src='" + _this + "' width='300'
height='225' > <br>"+mess+"</td></tr></table>";
document.getElementById("a1").innerHTML =t1;
//document.getElementById("a1").innerHTML = "<img src='" + _this.src + "' >";
document.getElementById("a1").style.top = document.body.scrollTop + event.clientY + 10 + "px";
document.getElementById("a1").style.left = document.body.scrollLeft + event.clientX + 10 + "px";
document.getElementById("a1").style.display = "block";
}
function hide(_this) {
document.getElementById("a1").innerHTML = "";
document.getElementById("a1").style.display = "none";
}
</script>
<table width="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><a herf="www.baidu.com" onmousemove="show(event,'http://www.baidu.com/img/baidu_logo.gif','www.baidu.com')"
onmouseout="hide(this)" >你好</a></td>
</tr>
</table>
<script>
function show(event,_this,mess) {
event = event || window.event;
var t1="<table cellspacing='1' cellpadding='10' style='border-color:#CCCCCC;background-color:#FFFFFF;font-
size:12px;border-style:solid; border-width:thin;text-align:center;'><tr><td><img src='" + _this + "' width='300'
height='225' > <br>"+mess+"</td></tr></table>";
document.getElementById("a1").innerHTML =t1;
//document.getElementById("a1").innerHTML = "<img src='" + _this.src + "' >";
document.getElementById("a1").style.top = document.body.scrollTop + event.clientY + 10 + "px";
document.getElementById("a1").style.left = document.body.scrollLeft + event.clientX + 10 + "px";
document.getElementById("a1").style.display = "block";
}
function hide(_this) {
document.getElementById("a1").innerHTML = "";
document.getElementById("a1").style.display = "none";
}
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询