S
samuelberthelot
I've got the following class. the onclick event works only with IE
although I believe I did proper handling for firefox. What is wrong in
this script ?
function PopupDiv(linkId, DivId){
this.Link = getEl(linkId);
this.Div = getEl(DivId);
var me = this;
this.Link.onclick = function Show(event){
var x = 0;
var y = 0;
if (me.Div.style.display == 'none' || me.Div.style.display == ''){
me.Div.style.display = "block";
debugger
if (!event) var e = window.event;
if (e.pageX || e.pageY)
{
x = e.pageX;
alert(x);
y = e.pageY;
}
else if (e.clientX || e.clientY)
{
x = e.clientX;
y = e.clientY;
}
me.Div.style.left = x - 200;
me.Div.style.top = y;
}else{
me.Div.style.display = "none";
}
}
}
thanks
although I believe I did proper handling for firefox. What is wrong in
this script ?
function PopupDiv(linkId, DivId){
this.Link = getEl(linkId);
this.Div = getEl(DivId);
var me = this;
this.Link.onclick = function Show(event){
var x = 0;
var y = 0;
if (me.Div.style.display == 'none' || me.Div.style.display == ''){
me.Div.style.display = "block";
debugger
if (!event) var e = window.event;
if (e.pageX || e.pageY)
{
x = e.pageX;
alert(x);
y = e.pageY;
}
else if (e.clientX || e.clientY)
{
x = e.clientX;
y = e.clientY;
}
me.Div.style.left = x - 200;
me.Div.style.top = y;
}else{
me.Div.style.display = "none";
}
}
}
thanks