第一次写javascript,在线等待解答。 y = event.clientY + (document.body || document.documentElement).scrollTop;// 加上滚动条高度document.body || document.documentElement 是为了兼容 W3C 和非 W3C 标准 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 标准的写法是不是横向的时候也加上(document.body || document.documentElement).scrollLeft; 在你的基础上改的<script type="text/javascript"> function $(id) { return document.getElementById(id); } function show(e,popmsg) { var x,y; x = e.clientX; y = e.clientY; $("poplay").innerHTML = popmsg; $("poplay").style.pixelLeft = x+10; $("poplay").style.pixelTop = y+20; $("poplay").style.visibility = "visible"; } function hide() { $("poplay").style.visibility = "hidden"; } document.write('<DIV id="poplay" style="position:absolute;background-color:#FFFF99;"></DIV>');</script><BODY> <BR> <a href=# onMouseOver="show('event','<img src=http://avatar.profile.csdn.net/C/8/6/2_afantict.jpg>')" onmouseout="hide()" target="_self">TOP PAGE</A><br><!--<A href="index.html" onmouseover="show('event','aaa<img src='http://avatar.profile.csdn.net/B/F/0/2_wanglinmingtina.jpg'>bbb');" target="_self">TOP PAGE </A> <BR> --> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <!--<A href="index.html" onmouseover="show(event,'aaa<img src\='http://avatar.profile.csdn.net/B/F/0/2_wanglinmingtina.jpg'>bbb')" onmouseout="hide()" target="_self">TOP PAGE2 </A> --><a href=# onMouseOver="show('event','abc')" onmouseout="hide()" target="_self">TOP PAGE2</a></BODY> dhtmlDragAndDrop 什么意思 为什么载入的时候只显示月份 年份不出来 为什么总是会alert出来 请大家帮忙,产品分类显示的问题!! 求助:字符串分组重新组合 失焦点 做判断 有办法判断一个IFRAME页面没有被成功加载吗,或者加载出现异常? IE为何不执行脚本? 如何让客户在地图图片上用鼠标自定义热区(销售点,因为会经常变化),并将热区坐标存入数据库中,希望用javascript和asp配合实现。 jquery中这种写法疑似木有 在线请教,如果对输入框输入全角的数字,如何利用js转移为半角的数字 JavaScript用下拉框实现个人简历
也加上(document.body || document.documentElement).scrollLeft;
<script type="text/javascript">
function $(id)
{
return document.getElementById(id);
}
function show(e,popmsg)
{
var x,y;
x = e.clientX;
y = e.clientY;
$("poplay").innerHTML = popmsg;
$("poplay").style.pixelLeft = x+10;
$("poplay").style.pixelTop = y+20;
$("poplay").style.visibility = "visible";
}
function hide()
{
$("poplay").style.visibility = "hidden";
}
document.write('<DIV id="poplay" style="position:absolute;background-color:#FFFF99;"></DIV>');
</script><BODY> <BR>
<a href=# onMouseOver="show('event','<img src=http://avatar.profile.csdn.net/C/8/6/2_afantict.jpg>')" onmouseout="hide()" target="_self">TOP PAGE</A><br><!--<A href="index.html" onmouseover="show('event','aaa<img src='http://avatar.profile.csdn.net/B/F/0/2_wanglinmingtina.jpg'>bbb');" target="_self">TOP PAGE </A> <BR> -->
<BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR> <BR>
<!--<A href="index.html" onmouseover="show(event,'aaa<img src\='http://avatar.profile.csdn.net/B/F/0/2_wanglinmingtina.jpg'>bbb')" onmouseout="hide()" target="_self">TOP PAGE2 </A> -->
<a href=# onMouseOver="show('event','abc')" onmouseout="hide()" target="_self">TOP PAGE2</a>
</BODY>