Jquery Fancybox Link Inside Div
I have a div containing information. Wraped around the div I have a 'a' tag so that when a user clicks anywhere around the div the fancy box opens. However inside the div I andothe
Solution 1:
Updated:This code should most probably work.
$(".listContent").live('click', function(e) {
e.preventDefault();
$(this).fancybox({
'type': 'ajax'
});
console.log('inside fancybox creator');
});
$("div.removeCompare").live('mousedown', function(e) {
e.stopPropagation();
console.log('inside remove');
$(this).parents(".listingContainer").remove();
});
I think your problem was with event propagation
- when you click on a child element the related event of parent too fires up. So e.stopPropagation()
will stop that.
Post a Comment for "Jquery Fancybox Link Inside Div"