Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between event.stopPropagation and event.stopImmediatePropagation?

Answer Posted / chaitanya

event.stopPropagation() allows other handlers on the same element to be executed, while event.stopImmediatePropagation() prevents every event from running. For example, see below jQuery code block.

Hide Copy Code

$("p").click(function(event){

event.stopImmediatePropagation();

});

$("p").click(function(event){

// This function won't be executed

$(this).css("background-color", "#f00");

});

If event.stopPropagation was used in previous example, then the next click event on p element which changes the css will fire, but in case event.stopImmediatePropagation(), the next p click event will not fire.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the features of jQuery, has been used in web applications?

787


How we can modify the css class in jquery?

749


How to use connect?

779


How do you get the text value of a selected option?

722


How to write browser specific code using jquery? : jquery mobile

830


Name some of the methods of jquery used to provide effects?

774


How can jquery library be added to pages? Write a basic jquery code?

748


How can you select all elements in a page using jquery?

766


How do you select all elements with the class of “selected” in jquery?

743


Explain the basic need to start with jquery? : jquery mobile

731


What is the difference between prop() and attr() in jquery?

750


What is the use of jquery.data()?

811


How to disable cut,copy and paste in TextBox using jQuery?

917


How do you install/use jquery in a project. What is the minimum setup needed to start using jquery.

851


Explain which program is useful for testing jquery?

9022