fancybox icon indicating copy to clipboard operation
fancybox copied to clipboard

How to work wordpress ajax with fancybox 3?

Open presslayouts opened this issue 9 years ago • 1 comments

Hello guys,

Why you have closed request without resolve our issue?

When i click on quick view button, then displayed full page ( Browser full page ) in popup, but I need to display only clickable one product in popup, not full page display in popup.

We will some mistack in fancybox popup js or html. Please you can see our below html code:

HTML Code: <a class="quickview" href="#" data-product_id="187">Quick View</a>

JS Code:

$(document).on('click', '.quickview', function(e) {
	e.preventDefault();
	var pid = $(this).attr('data-product_id');

	$.fancybox.open({
		src  : myAjax.ajaxurl + '?action=fan_product_quickview&pid=' + pid,
		type : 'ajax',
		opts : {
			onComplete : function() {
				$('.flex-control-thumbs').owlCarousel({
					loop: true,
					responsiveClass: true,
					responsiveRefreshRate : 10,
					rtl : fan_rtl,
					nav: true,
					navText: ['',''],
					dots:false,
					items: 3,					
				});	
			}
		}

	});

	return false;
});

Thank you so much for your help !!!

presslayouts avatar Apr 19 '17 13:04 presslayouts

First, do not make duplicates.

Second, I do not see any issue of the fancyBox itself and I could not understand what do you want.

For example, what does "We will some mistack in fancybox popup js or html. " mean? I do not see any sense here.

fancyapps avatar Apr 19 '17 13:04 fancyapps