簡體   English   中英

由於固定的導航,在fancybox的頂部和底部添加了頁邊距

[英]Adding margin to top and bottom of fancybox due to fixed navigation

由於我使用在此問題中找到的代碼,在頁面頂部具有固定的導航欄,因此在fancybox圖像的頂部和底部添加了頁邊距。 我已經將它添加到我的jQuery中,就像它說的那樣:

<script type="text/javascript">
    $("a.fancybox").fancybox({
    margin: [120, 60, 50, 60] // top, right, bottom, left
});</script>

在此以下:

<script type="text/javascript">
    $(document).ready(function() {
    $("a.fancybox").fancybox({
        'transitionIn'  :   'fade',
        'transitionOut' :   'fade',
        'speedIn'       :   600, 
        'speedOut'      :   200, 
        'overlayShow'   :   true
    }); 

    });
    </script>

問題在於,單擊單個圖像時,它可以按照我想要的方式工作(位於導航上方),但在瀏覽圖像時,接下來的又一個較高(面向人像)的圖像又位於導航后面。 我嘗試增加最高保證金值,但沒有任何變化。

這是上面帶有fancybox的頁面: http : //pacificdesignacademy.com/gallerygd.php

我在這里做錯什么了嗎? 任何建議,不勝感激。 謝謝!

改變這個

<script type="text/javascript">
    $(document).ready(function() {
    $("a.fancybox").fancybox({
        'transitionIn'  :   'fade',
        'transitionOut' :   'fade',
        'speedIn'       :   600, 
        'speedOut'      :   200, 
        'overlayShow'   :   true
    }); 

    });
    </script>
    <script type="text/javascript">
    $("a.fancybox").fancybox({
    margin: [120, 60, 50, 60] // top, right, bottom, left
});</script>

這樣

<script type="text/javascript">
$(document).ready(function () {
    $("a.fancybox").fancybox({
        'transitionIn': 'fade',
         'transitionOut': 'fade',
         'speedIn': 600,
         'speedOut': 200,
         'overlayShow': true,
         margin: [120, 60, 50, 60] // top, right, bottom, left
    });
});
</script>

注意 :您的API選項已過時(v1.3.4),請查看文檔以獲取所使用版本的正確選項

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM