Fancybox v.2.1.2 not opening on IE7

2020-02-14 10:39发布

问题:

I am using Fancybox v.2.1.2 in Wordpress (not a plugin). In IE7, I have the loading but it does not opening anything at all.

Here is my JS code

<!-- Add fancyBox main JS and CSS files -->
<script type="text/javascript" src="/path/to/fancybox/source/jquery.fancybox.js?v=2.1.2"></script>
<link rel="stylesheet" type="text/css" href="/path/to/fancybox/source/jquery.fancybox.css?v=2.1.2" media="screen" />
<script>
jQuery(document).ready(function() {
     jQuery("a.fancybox").fancybox({
        padding : 0
    });  
});
</script>

And here is my code in my page :

<a href="/path/to/images/P1050615.jpg" class="fancybox" rel="gallery[283]"></a>
<div class="hidden">
 <a class="fancybox" href="/path/to/images/P1050616.jpg" rel="gallery[283]"><img src="/path/to/images/P1050616.jpg"></a>
 <a class="fancybox" href="/path/to/images/P1050617.jpg" rel="gallery[283]"><img src="/path/to/images/P1050617.jpg"></a>
</div>

I am using the HTML5 Doctype but even when I am changing it, it does not change anything.

回答1:

I am afraid that this is a bug (it's not your fault, it's not your code).

I have contacted directly the developer and he confirmed to me that the issue is expecting to be fixed in the next commit.

You may rollback to version v2.1.1 in the meantime.

UPDATE : Fancybox v2.1.3 has been released

Changelog Version 2.1.3 - October 23, 2012

  • Fixed #426 - Broken IE7
  • Fixed #423 - Background flickering on iOS
  • Fixed #418 - Automatically Grow/Shrink and Center
  • Updated the script to work with jQuery 1.6
  • Media helper supports YouTube video series


回答2:

I find the bug ... not in Fancybox but into IE7, IE8, and IE9 !

If you create an iframe with a page that contain the following CSS, then IE do not display the page :

html { position: relative; }

If you know the webmaster of the destination page, ask him to remove this CSS declaration, the display of it's page should not change ... otherwise, no solution to my knowledge!

That's all !