我有下面的代码示例,我想在fancybox中打开视频,它几乎可以在所有浏览器中正常工作,除非当我尝试在IE 8标准模式下测试它时。fancybox-1.3.4在iE8中不起作用
它在IE 9及以上版本中正常工作。
基于this solution我添加以下代码行,但这并不能使它工作,要么iframe: { preload: false }
HTML代码减速是
<!DOCTYPE html >
<html lang="en">
<head id="Head1" runat="server">
<title></title>
.........
示例代码
<div class="video-icon">
<a href="http://www.youtube.com/embed/CR0AXNtwqZE?autoplay=1" class="fancybox-video"><img src="coorporate-video-icon.jpg"/></a>
</div>
$("a.fancybox-video").fancybox({
width: 600,
height: 440,
closeClick: true,
hideOnOverlayClick: true,
type: 'iframe',
iframe: { preload: false // fixes issue with iframe and IE
}
});
我不知道是什么打破了它,我不能创建一个小提琴的例子,因为小提琴不起作用IE 8在这方面的任何帮助表示赞赏。
UPDATE:我用的fancybox 2.1.3版尝试过,但我仍然面临着同样的问题..
为什么不使用Fancybox 2? Fancybox 1已停用一段时间。 – Raptor
[本文]中的解决方案(http://stackoverflow.com/questions/14819642/fancybox-stuck-loading-iframe-in-ie)适用于fancybox v2.x. Fancybox 2.x选项与v1.x不兼容 – JFK
@ShivanRaptor:人们可能不想使用v2.x的原因是因为它的许可限制,所以他们更愿意坚持v1.3.4(它不会中止) – JFK