fancybox icon indicating copy to clipboard operation
fancybox copied to clipboard

Fancybox retrieves the "image" twice

Open Wbmstrmjb opened this issue 12 years ago • 2 comments

I have a PDF that is dynamic and being displayed in fancybox (quite nicely by the way).

But the pdf is being requested a second time on close of the fancy box popup. Is there a way to prevent this? The site "works" fine, but the server is having to generate the pdf twice for no reason.

image

If this helps:

$.fancybox({ type: 'html', height: '95%', width: '60%', fitToView: false, autoSize: false, overlayShow: true, hideOnContentClick: false, content: '', beforeClose: function() { $(".fancybox-inner").unwrap(); } });

Wbmstrmjb avatar Mar 12 '14 22:03 Wbmstrmjb

Why do you have $(".fancybox-inner").unwrap();? I suspect it can cause iframe reload and therefore your file might generate twice.

fancyapps avatar Mar 13 '14 06:03 fancyapps

That's what happens when you copy code from the internet and not sure which pieces you need and don't need. Thanks! Works perfect now!

Wbmstrmjb avatar Mar 13 '14 07:03 Wbmstrmjb