document.onclick中event的问题
当前位置:点晴教程→知识管理交流
→『 技术文档交流 』
<html> <head> <title> click </title> <script language= "javascript "> document.onClick = clickstat(); function clickstat() { var tempx,tempy; tempx = event.clientX + document.body.scrollLeft; tempy = event.clientY + document.body.scrollTop; alert( "ok "); } </script> </head> <body> </body> </html> RT,无法获取event?请问大家是怎么回事...谢谢 答案: <html>
<head> <title> click </title> <script language= "javascript "> function clickstat() { var tempx,tempy; tempx = event.clientX + document.body.scrollLeft; tempy = event.clientY + document.body.scrollTop; alert( "ok "); } document.attachEvent( "onclick ",clickstat); </script> </head> <body> </body> </html> ---------------------------------------------或者--------------------------------- <html> <head> <title> click </title> <script language= "javascript "> document.onclick = function() { var tempx,tempy; tempx = event.clientX + document.body.scrollLeft; tempy = event.clientY + document.body.scrollTop; alert( "ok "); } </script> </head> <body> </body> </html> 该文章在 2011/1/23 1:05:15 编辑过 |
关键字查询
相关文章
正在查询... |