The problem is with the line
dv.attachEvent("onmouseclick",function(){element_event_onmouseclick();}); because both IE and FF attach events differently via javascript.
For solution to this, first check the browser type. A simple though not very powerful way can be
//detecting the browser version
var bname = navigator.appName;
var isIE = false;
if (bname == "Microsoft Internet Explorer"){
isIE = true;
}
else{
isIE = false;
} Now in the js function attach the events as,
// attach event onmouseclick to the created div tag
if(isIE){
dv.onclick = new Function("element_event_onmouseclick()");
}
else{
dv.setAttribute("onclick", "element_event_onmouseclick()");
} To delete the div section you can either remove it as,
dv = document.getElementById('lyr1');
document.forms[0].removeChild(dv);
or apply CSS to make it invisible. The css attributes are
display:none;
visibility:hidden; Hope this solves your issue
parry_kulk
Junior Poster
Team Colleague
167 posts since Jan 2007
Reputation Points: 26
Solved Threads: 41