0

I have this web page where are two links at the bottom (aaa, bbb) which runs bumpbox(lightbox alternative). In Opera, FF, Chrome works javascript code which connect (binocular) icon on the map with these links, but not in IE. There are no problems in the console. I've tried IE7,8. Thank you for your help!

the funcion (I think the problem is with the /* for IE */ part):

function fireEvent(element, event){
if (document.createEventObject){
/* for IE */
return element.fireEvent('on' + event, document.createEventObject());
}else{
/* for other browsers */
var evt = document.createEvent('HTMLEvents');
evt.initEvent(event, true, true);
}
return !element.dispatchEvent(evt);
}


google.maps.event.addListener(pano01, 'click', function() {    
fireEvent(document.getElementById("c01").getElementsByTagName("a")[0], 'click');

1 Answer 1

2

Try changing

return element.fireEvent('on' + event, document.createEventObject());

to

return element[event]();

It should work fine with click.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.