jcdevelopment
01-03-2008, 07:34 PM
When i validate my JS the only error i get is this
function mouseCoords(ev){
if(ev.pageX || ev.pageY){
return {x:ev.pageX, y:ev.pageY};
}
return {
x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
y:ev.clientY + document.body.scrollTop - document.body.clientTop
};
}
it says mouseCoords is not defined....
Why would it be saying that, im fairly new to JS so any help would be great, let me know if you need anything else
function mouseCoords(ev){
if(ev.pageX || ev.pageY){
return {x:ev.pageX, y:ev.pageY};
}
return {
x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
y:ev.clientY + document.body.scrollTop - document.body.clientTop
};
}
it says mouseCoords is not defined....
Why would it be saying that, im fairly new to JS so any help would be great, let me know if you need anything else