Code:
$(document).ready(function() {
$("#main_div").bind('click', function(e){
var x = event.pageX-document.getElementById("main_div").scrollLeft;
var y = event.pageY-document.getElementById("main_div").scrollTop;
document.pointform.form_x.value = x;
document.pointform.form_y.value = y;
var a= x-404;
var b= y-88;
if(document.getElementById('optionselect').value=='a')
{
$("#container-5").css({"top":b,"left":a});
$("#container-5").show();
e.stopPropagation();
}
else if(...)
{
...
}
});
});
Hey Guys, the code is working fine in IE and Chrome but when i try to run the same in firefox it throws an error ‘event is not defined’ and points the cursor where var x is defined. How do i overcome this problem?
Change
To
And everything should be alright 🙂