King Julien
King Julien

Reputation: 11308

Display fancybox loading icon

When I use fancybox for iframe, the loading icon isn't displayed while fancybox is loaded...

How can I fix this problem?

Thanks in advance.

Upvotes: 4

Views: 15174

Answers (2)

Kunal Panchal
Kunal Panchal

Reputation: 1059

For FancyBox 2 showing loader with overlay

To show

$.fancybox.showLoading();
$.fancybox.helpers.overlay.open({parent: $('body'), closeClick : false});

To hide

$.fancybox.hideLoading();
$.fancybox.helpers.overlay.close();

Upvotes: 6

jonagoldman
jonagoldman

Reputation: 8754

Fancybox have some bugs or problems when using iframes.

You can edit the source code (not the compressed, packed or minified version) and put this:

$.fn.fancybox.showLoading();

For displaying the loading box in FancyBox 2:

$.fancybox.showLoading()  ;

right after this:

} else if (href.match("iframe") || elem.className.indexOf ("iframe") >= 0) {

I think its in line number 131 but I'm not sure you just need to search for it in the source code.

This and nother (more complicated) solutions, are in the support group of Fancybox:

Fancybox iframe loading icon fix

loading indicator

or do a search in the Fancybox support group.

Good look!

Upvotes: 4

Related Questions