jquery - Fancybox popup prevent when checkbox is clicked -
i have problem checkbox in image.while clicking on image fancybox opened fine.if click on checkbox again fancybox opened.it should not opened when checkbox click.
html code
<div class="picture"> <a href="http://farm1.staticflickr.com/313/19831416459_5ddd26103e_m.jpg" class="fancybox popup_fancy" rel="gallery1" id="fancybox_popup"> <img src="http://farm1.staticflickr.com/313/19831416459_5ddd26103e_m.jpg" alt=""> <div class="img-overlay"> <input type="checkbox" class="img_checkobx" name="imgcheckbox" onclick="checkbox(this);"/> </div></a> </div>
image appear this
and fancybox js this
$(document).ready(function() { $(".fancybox").fancybox({ openeffect : 'none', closeeffect : 'none' }); });
prevent fancybox popup when checkbox click event. suggest how solve problem.thanks in advance
just stop propagation
of event
siblings
using e.stopimmediatepropagation()
on checkbox click
below:
$('.img_checkobx').click(function(e){ e.stopimmediatepropagation(); });
Comments
Post a Comment