社区
JavaScript
帖子详情
如果在firefox下获得鼠标坐标??
surfchen
2005-03-18 02:31:45
如果在firefox下获得鼠标坐标??
以下代码为何无法获得??
<script type="text/javascript">
<!--
function alertX()
{
alert(window.screenX)
}
-->
</script>
<div onMouseOver="alertX()">getX</div>
...全文
503
13
打赏
收藏
如果在firefox下获得鼠标坐标??
如果在firefox下获得鼠标坐标?? 以下代码为何无法获得?? getX
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
13 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
ice_berg16
2005-03-24
打赏
举报
回复
e = e || window.event
=>
e = e ? e : window.event;
你看下fason这篇
http://community.csdn.net/Expert/topic/3673/3673363.xml?temp=.9517328
surfchen
2005-03-23
打赏
举报
回复
up
ice_berg16
2005-03-23
打赏
举报
回复
firefox下的事件驱动和IE下有所区别
事件函数必须传递事件,你这个函数在IE下也是通不过的,screenX不是window对象的属性,是event的
<script type="text/javascript">
<!--
function alertX(e)
{
e = e || window.event;
alert(e.screenX)
}
-->
</script>
<div onMouseOver="alertX(event)">getX</div>
surfchen
2005-03-23
打赏
举报
回复
e = e || window.event;这种的用法是什么意思呢?
有没有详细解说ie和firefox事件驱动的文章?我想认真看看.
chaobill
2005-03-21
打赏
举报
回复
DOM Event Reference
clientX Returns the horizontal position of the event.
clientY Returns the vertical position of the event.
http://www.mozilla.org/docs/dom/domref/
http://www.mozilla.org/docs/dom/domref.zip
做Firefox必看
surfchen
2005-03-21
打赏
举报
回复
firefox里的clientX和IE下的好象有不同~~~~包括获得该属性~~~
如果我要在某个元素里触发获得鼠标事件,在firefox 下,脚本是不是必须包含这样的语句块??
document.getElementById(id).event
之前我看到过一个在body 元素下通过mouseover获得鼠标坐标的代码段~~兼容IE和firefox
但是我想用在非body 元素下却始终不成功~~
各位前辈高人都说说话吧~~~郁闷死了~~想兼容一下IE和FF,真是难~~ 偶对DOM又比较生疏...
surfchen
2005-03-21
打赏
举报
回复
up
surfchen
2005-03-20
打赏
举报
回复
up
surfchen
2005-03-19
打赏
举报
回复
UP
surfchen
2005-03-19
打赏
举报
回复
行的吧??我好象以前看过有人贴过一段能获得firefox下鼠标坐标的代码了
cybernaute
2005-03-19
打赏
举报
回复
firefox 好象不行的
ie下的也是event.clientX
surfchen
2005-03-19
打赏
举报
回复
UP
surfchen
2005-03-18
打赏
举报
回复
本帖所有的“果”改为“何”
火狐兼容获取
鼠标
的
坐标
NULL 博文链接:https://hnxsszq.iteye.com/blog/1558050
Javascript获取
鼠标
坐标
的各种类型
描述javascript获取
鼠标
坐标
的各种方式,其中有图说明,很清晰,很容易理解!
JS
获得
鼠标
位置(兼容多浏览器ie,
firefox
)
NULL 博文链接:https://conkeyn.iteye.com/blog/507881
event兼容调用(IE,
Firefox
,Chrome)
event兼容调用(IE,
Firefox
,Chrome)
Firefox
的
鼠标
手势_JavaScript_HTML_下载.zip
Firefox
的
鼠标
手势_JavaScript_HTML_下载.zip
JavaScript
87,992
社区成员
224,698
社区内容
发帖
与我相关
我的任务
JavaScript
Web 开发 JavaScript
复制链接
扫一扫
分享
社区描述
Web 开发 JavaScript
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章