document.onclick中event的問題
當(dāng)前位置:點(diǎn)晴教程→知識(shí)管理交流
→『 技術(shù)文檔交流 』
<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?請(qǐng)問大家是怎么回事...謝謝 答案: <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 編輯過 |
關(guān)鍵字查詢
相關(guān)文章
正在查詢... |