我有下面的代碼示例,我想在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