Answer the question
In order to leave comments, you need to log in
Why is fancybox 3 ajax not working on reclick?
Hello. There is a regular html link with data parameters changing in it:
<a href="#" class="askPriceBtn" data-product="Yeti 51003" data-id="10062">Узнать стоимость</a>
$('.askPriceBtn').on('click', function(event) {
event.preventDefault();
$.fancybox.open({
src: '/includes/askPriceForm.php?id=' + $(this).data('id') + "&iblock=" + $(this).data('iblock'),
type: 'ajax',
opts : {
afterShow : function( instance, current ) {
$('[type="checkbox"]').iCheck({checkboxClass: 'icheckbox_square-red'});
}
}
})
});
$('.askPriceBtn').on('click', function(event) {
event.preventDefault();
$.fancybox.open({
src: '/includes/askPriceForm.php',
type: 'ajax',
ajax: {
type: 'GET',
data: {
...
}
}
opts : {
afterShow : function( instance, current ) {
$('[type="checkbox"]').iCheck({checkboxClass: 'icheckbox_square-red'});
}
}
})
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question