|
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;
}
}
|