我爱Aspx >> Asp.Net >> 点鼠标,弹出一个层,并且跟随鼠标,如何作啊?---在线我希望在一个连接上点击鼠标后,弹出一个层,并且这个层的位置是根据鼠标的位置走的。
google_ad_width = 250; google_ad_height = 250; google_ad_format = "250x250_as"; google_color_url = "000000";
如何实现阿?
第2楼. 由 hookee 于 2007-6-27 13:26:36 发表
<script>
function flow(){
x = event.x;
y = event.y;
var obj = document.getElementById("pad");
obj.style.left = x;
obj.style.top = y;
}
function init(){
var obj = document.getElementById("pad");
document.body.onmousemove = flow;
obj.style.visibility = "visible";
}
</script>
<input type="button" onclick="init();">
<div id="pad" style="position:absolute;left:0px;top:0px;width:100px;height:100px;background-color:red;visibility:hidden;"></div>
第3楼. 由 palocc 于 2007-6-27 14:27:12 发表
可能我没说清楚,我是说鼠标点击后根据鼠标的位置显示这个层,不过这个层不用跟随鼠标移动。只要显示在相应位置就行。
第4楼. 由 palocc 于 2007-6-27 14:29:04 发表
好了,我根据你的代码修改了一下~
多谢~
Ҷƪл˵?
CSS样式的一点小疑惑[07-06]
求超链效果,在线等速结[07-06]
背景颜色为何会扩展到其它区域?[07-06]
这个效果不能直接用在<a>标..[07-06]
请教为什么大尺寸图片在firefox下..[07-06]
<p>的行间距怎么做?[07-06]
CSS定义了表格的宽度,而一个页面..[07-06]
是否滤镜效果不能在table里使用呀..[07-06]
<nobr>在opera浏览器里面失..[07-06]
请问什么样的页面设计算是基于We..[07-06]