Posts Tagged with body

Displaying 1-1 of 1 result.
Resolved: Javascript body onclick function event
posted by admin on December 15, 2016
I have a function and onmousemove event in body attribute.
JS

function mouseShowHandler(e){

e = e || window.event


if (e.pageX == null && e.clientX != null ) {

var html = document.documentElement

var body = document.body

e.pageX = e.clientX + (html && html.scrollLeft || body && body.scrollLeft || 0) - (html.clientLeft || 0)

e.pageY = e.clientY + (html && html.scrollTop || body && body.scrollTop || 0) - (html.clientTop || 0)



}
xx=e.pageX
yy=e.pageY
}


HTML

...
<body onmousemove="mouseShowHandler(event)">
...

It is working fine, But I want to event handler to my script file, and remove from bodyRead more