onmouseover = function ()这种写法,如何传入元素对象本身?
資深大佬 : qazwsxkevin 10
为了容易维护,方便区分表格,和测试等事情
我没有在 testtbl 的 table 标签上使用 onmouseover=someFunction(event,this)的方式去调用函数…
目前只用.onmouseover = function ()的
tartable = document.getElementById('testtbl'); tartable.onmouseover = function (event,obj) { // <--obj 改 this 是不行的 t_clientX = event.clientX - obj.offsetLeft; y_clientY = event.clientY - obj.offsetTop; document.all('tester').innerHTML = t_clientX }
想获得鼠标在 testtbl 这个表格元素内的 tx,ty 坐标,
然后只在表格范围内画一个跟随鼠标游动的十字准星光标
大佬有話說 (8)