javascript - Avoid jQuery click function on <a href=""> elements -
this question has answer here:
- disable hyperlink using jquery 11 answers
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();})
Comments
Post a Comment