I’m trying to get a page to have cross browser support, however I keep getting stuck on Mozilla Firefox. I have IE and Chrome working though. The code is:
function positiontip(e){
var e = window.event ? event : e;
if (enabletip) {
var curX;
var curY;
if (e.pageX || e.pageY) {
curX = e.pageX;
curY = e.pageY;
} else if (e.clientX || e.clientY) {
curX = e.clientX + document.body.scrollLeft
+ document.documentElement.scrollLeft;
curY = e.clientY + document.body.scrollTop
+ document.documentElement.scrollTop;
}
When ever I try to use the code, Firefox console spits out an error that
e is undefined "if (e.pageX || e.pageY) {"
I have tried calling the function via
positiontip();
and
positiontip(event);
But neither are working.
any ideas?
Nevermind. The problem was that the function positiontip() was called in another function and the other function was being passed the event. I had to changed the html to pass the event to showtooltip() [the upper function] that then passed the event to positiontip().