i have created an Map and put hotspot on them and onclick event of hotspot iam showing a popup it's functioning properly in IE all version but not functioning in Firefox and chrome.
<area shape="rect" coords="226,201,244,221" onclick="Popup.show('mapDiv08');return false;" href="#" alt="this is orange county"/>
i think following javascript need to be changed ,in folowing javascript i ma taking mouse pointer X and Y cordinate,if this is qrong then how to take mouse cordinate in chrome and firefox
i have tried the way u have mentioned but still can't able to get the cordinates,following is the javascript code for reference,in case of CANVAS i got alert as NULL,i guess getElementById("canvas")
is not funtioning
var x = new Number();
var y = new Number();
var canvas = document.getElementById("canvas");
alert(canvas);
x = event.clientX + document.body.scrollLeft +
document.documentElement.scrollLeft;
y = event.clientY + document.body.scrollTop +
document.documentElement.scrollTop;
x -= canvas.offsetLeft;
y -= canvas.offsetTop;
ajay_sanhotr...
Member
76 Points
71 Posts
Image Map onclick event not functioning in Chrome and firefox
Sep 25, 2011 05:06 AM|LINK
i have created an Map and put hotspot on them and onclick event of hotspot iam showing a popup it's functioning properly in IE all version but not functioning in Firefox and chrome.
<area shape="rect" coords="226,201,244,221" onclick="Popup.show('mapDiv08');return false;" href="#" alt="this is orange county"/>ajay_sanhotr...
Member
76 Points
71 Posts
Re: Image Map onclick event not functioning in Chrome and firefox
Sep 25, 2011 05:43 AM|LINK
i think following javascript need to be changed ,in folowing javascript i ma taking mouse pointer X and Y cordinate,if this is qrong then how to take mouse cordinate in chrome and firefox
var isIE = document.all ? true : false; if (!isIE) { _x = e.pageX; _y = e.pageY; } if (isIE) { _x = event.clientX; //+document.body.scrollLeft; _y = event.clientY; //+document.body.scrollTop; } posX = _x; posY = _y; left= posX; top = posY;ajay_sanhotr...
Member
76 Points
71 Posts
Re: Image Map onclick event not functioning in Chrome and firefox
Sep 25, 2011 06:15 AM|LINK
In crome X Y cordinate could be get using
raju dasa
Star
14412 Points
2452 Posts
Re: Image Map onclick event not functioning in Chrome and firefox
Sep 25, 2011 04:06 PM|LINK
HI,
instead of Map try using the Canvas in FF,Chrome.
load image on Canvas and check its coords.
https://developer.mozilla.org/en/Canvas_tutorial/Using_images
rajudasa.blogspot.com || blog@opera
ajay_sanhotr...
Member
76 Points
71 Posts
Re: Image Map onclick event not functioning in Chrome and firefox
Sep 26, 2011 05:48 AM|LINK
i have tried the way u have mentioned but still can't able to get the cordinates,following is the javascript code for reference,in case of CANVAS i got alert as NULL,i guess getElementById("canvas") is not funtioning
var x = new Number(); var y = new Number(); var canvas = document.getElementById("canvas"); alert(canvas); x = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; y = event.clientY + document.body.scrollTop + document.documentElement.scrollTop; x -= canvas.offsetLeft; y -= canvas.offsetTop;