2011-11-23 87 views
2

我一直在調查這一點,現在已經成爲卡住。fancybox不工作在Firefox中

我已經加載了一個簡單的fancybox彈出到我的網站上,它適用於IE9和Chrome完美,但由於某種原因它不工作在Firefox中。

我在使用IIS

代碼爲incudes時刻運行這個局部是:

<script type="text/javascript"src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> 
<script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/fancybox/jquery.fancybox-1.3.4.pack.js"></script> 
<script type="text/javascript"> 
$(document).ready(function() { 

    /* This is basic - uses default settings */ 

    $("a.imagepop").fancybox(); 

}); 
</script> 

和HTML是:

<a class="imagepop" href="/wp-content/uploads/2011/11/imageTest1.png"><img class="alignnone size-full wp-image-30" title="imageTest1" src="http://localhost:8084/wp-content/uploads/2011/11/imageTest1.png" alt="" width="327" height="328" /></a> 

我曾試圖用螢火但它告訴我的是:使用getAttributeNodeNS()已被棄用。改用getAttributeNS()。

+0

您使用的是哪個版本的Firefox?你有沒有嘗試過使用FancyBox 2而不是1.3.4? –

+0

虐待那一個,並在ff7剛剛升級到8 – odd

+0

我剛剛嘗試過Firefox最新版本9,並且效果很好!以及您使用的是哪個版本?並且您是否包含「CSS」。 – coder

回答

1

這是我如何做,並在Firefox中運行良好:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> 
    <link href="jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.css" rel="stylesheet" 
     type="text/css" /> 
    <script src="jquery.fancybox-1.3.4/fancybox/jquery.mousewheel-3.0.4.pack.js" type="text/javascript"></script> 
    <script src="jquery.fancybox-1.3.4/fancybox/jquery.fancybox-1.3.4.pack.js" type="text/javascript"></script> 



    <script type="text/javascript"> 
    $(document).ready(function() { 

     /* This is basic - uses default settings */ 

     $("a.imagepop").fancybox(); 

    }); 
    </script> 

    <div> 
    <a class="imagepop" href="http://wallpapers.leovacity.be/images/Beautiful_flowers.jpg"><img class="alignnone size-full wp-image-30" title="imageTest1" src="http://wallpapers.leovacity.be/images/Beautiful_flowers.jpg" alt="" width="327" height="328" /></a> 
    </div> 
+0

更新到fb2,它的工作原理 – odd

+0

太棒了!很高興它幫助你。 – coder

0

According to this answer,這是Firefox 7的問題。使用FancyBox 2 instead怎麼樣?

編輯:使用FancyBox 2與Firefox 7在本地工作正常。

+0

謝謝你們,我剛剛更新到FB2,它的工作原理...不知道有一個v2 – odd

0

已包含在該頁面的JS文件?如果是,請嘗試刪除它們。我從未遇到FF中的問題,但其他腳本可能會導致問題。

+0

fb 2解決了這個問題,歡呼 – odd

0

當我有問題的fancybox的iFrame彈出Firefox中不工作像它在Chrome或IE瀏覽器,我通常添加到了內嵌框架彈出頁面的HTML標題,然後經常在Firefox:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"> 
0

在頁面上的fancybox庫之前移動第三方庫(即jquery控件)的引用。

+0

歡迎來到Stack Overflow!請不要在多個問題上發佈相同的答案。發佈一個很好的答案,然後投票/標記以重複關閉其他問題。如果問題不重複,*定製您的問題答案。* – durron597