javascript - Avoid jQuery click function on <a href=""> elements -


this question has answer here:

i have following click function on div element. inside div element links. how can stop click function on links? tried z-index doesn't work.

$('.thumb.flip').click(function () {  if ($(this).find('.thumb-wrapper').hasclass('flipit')) {      $(this).find('.thumb-wrapper').removeclass('flipit');  } else {      $(this).find('.thumb-wrapper').addclass('flipit');  } }); 

add code stop click propagating links dom div:

$('a').click(function(e){e.stoppropagation();}) 

see http://api.jquery.com/event.stoppropagation/

jsfiddle example


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -