|
windows.event is accsible directly in IE. but to access event it has to be passed as an object in firefox from an element. this is how you do it.
the following code is to cancel bubble or bubbling. this occurs when you click on an inner element and its bubbled to the top element. example onclick if its nested
the on click of the innter element is activaated and the onclick of the outer element is called.
below is the code to stop problms with nested bubble
document.getElementById('template').onclick = function(e){pagebuilderclick(e,this);}
function pagebuilderclick(evnt,ele)
{
if(navigator.appName == "Microsoft Internet Explorer")
{
if (!e) var e = window.event;
e.cancelBubble = true;
if (e.stopPropagation)
e.stopPropagation();
}else
{
evnt.stopPropagation();
evnt.cancelBubble = true;
}
}
|