hi
I am new to JavaScript,I want to know how to get clientX in NetScape browser?
I used “window.event.clientX” but I am getting window.event undefined error!
please Help
thanks in advance.:rambo:
hi
I am new to JavaScript,I want to know how to get clientX in NetScape browser?
I used “window.event.clientX” but I am getting window.event undefined error!
please Help
thanks in advance.:rambo:
Your syntax is incorrect. Try window.clientX (it’s not an event)
Actually, I think clientX is a property of the Event object. In any case… try this function. It’s cross-browser friendly:
function mouseX(e)
{
if(e.pageX) {
return e.pageX;
} else if(e.clientX) {
return e.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
} else {
return null;
}
}
[quote=jwilliam;2357545]Actually, I think clientX is a property of the Event object. In any case… try this function. It’s cross-browser friendly:
[/quote]
You are correct, sorry for the misinformation.
:: Copyright KIRUPA 2024 //--