Search code examples
javascriptfancybox

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.


Solution

  • 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!