Fancybox stuck loading iframe in IE

后端 未结 2 820
一生所求
一生所求 2020-11-28 15:28

I\'m having problems loading a PDF in an iframe in IE using fancybox. When I click the link, I get the gif loader and it just spins forever. No errors in the console or on t

相关标签:
2条回答
  • 2020-11-28 15:46

    It seems like disabling pre-loading fixes the issue with iframes and IE so try this :

      $(document).ready(function () {
          /* fancybox handler */
          $('.fancybox-media').fancybox({
              openEffect: 'none',
              closeEffect: 'none',
              autoSize: true,
              type: 'iframe',
              iframe: {
                  preload: false // fixes issue with iframe and IE
              }
          });
      });
    

    Tested with fancybox v2.1.4 and IE7.

    Check JSFIDDLE

    0 讨论(0)
  • 2020-11-28 16:03

    i just test your snippet code and it worked for me in ie 8 and chrome

    i use resource files from:

    jquery: http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.min.js

    js: http://fancybox.net/js/fancybox-1.3.4/jquery.fancybox-1.3.4.js

    css: http://fancybox.net/js/fancybox-1.3.4/jquery.fancybox-1.3.4.css

    code i used:

    <!DOCTYPE html>
    <html lang="en" >    
        <head>
            <meta charset="utf-8">
    
            <link rel="stylesheet" type="text/css" href="http://fancybox.net/js/fancybox-1.3.4/jquery.fancybox-1.3.4.css" />
    
            <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.min.js" type="text/javascript"></script>
            <script type="text/javascript" src="http://fancybox.net/js/fancybox-1.3.4/jquery.fancybox-1.3.4.js"></script>
            <script>
                $(document).ready(function(){
                    /* fancybox handler */
                    $('.fancybox-media').fancybox({
                        openEffect  : 'none',
                        closeEffect : 'none',
                        autoSize: true,
                        type : 'iframe'
                    });
                });
            </script>
    
        </head>
        <body>
            <a class="fancybox-media italic" href="pdf.pdf" >Test Doc</a>
        </body>
    </html>
    
    
    maybe clear browser cach fix it
    
    0 讨论(0)
提交回复
热议问题