Lets Have a fun with Technology.

BTemplates.com

Follow by Email

Sunday, March 13, 2016

How to stop Bubbling on click event.


How to stop Bubbling on click event.

Hello,

It may case you want to kill bubbling on the click event.

JQuery will help you to achieve this by event.stopPropagation().

Below is example of kill the bubbling on button click.





$(document).ready(function()

{

$("#<%= btnArrow.ClientID %>").on ('click', function(event){event.stopPropagation();});

//Kill the bubbling

});




You may call event.stopPropagation() from function.

For Example below I am calling RadPrompt.




radprompt('Enter Name', promptCallBackFn);



function promptCallBackFn(arg) {

//Do your code.

event.stopPropagation();

//This will prevent Bubbling.

}


0 comments:

Post a Comment