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 • 2 comments

Hello facnyapps,

OOhh very fast support serves, Very good.

Thank you again, Our facancybox popup complete working now, but our full page display in popup. why?

I need to display clickable only one product in popup, but display full page 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

Sorry, I could not understand.

fancyapps avatar Apr 19 '17 13:04 fancyapps

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