2

ファンシーボックスとその動作のコードを書きますが、ファンシーボックスの高さと幅を設定したいのですが、動作しません。以下のコードを使用します。

Javascript

    <script type="text/javascript" src="/javascript/jquery/plugins/fancybox/fancybox.js?b84fd"></script>

<script type="text/javascript">

$(document).ready(function() {

/* This is basic - uses default settings */

$("a#single_image").fancybox();

/* Using custom settings */

$("a#inline").fancybox({
'hideOnContentClick': true
});



/* Apply fancybox to multiple items */

$(".iframe").fancybox({
'transitionIn'    :    'elastic',
'transitionOut'    :    'elastic',
'speedIn'     :    600,
'speedOut'     :    200,
'overlayShow'    :    false,
'width'  : 600,           // set the width
    'height' : 600,           // set the height
    'type'   : 'iframe',       // tell the script to create an iframe
    'scrolling'   : 'no'

});

});

</script>

HTMLコード

<a id="inline" href="/content/test.html">Test</a>

ファンシーボックスの高さと幅を設定する方法を教えてください。

このリンクを使用して bigcommerce で fancybox を使用します ヘルプBig commerce ヘルプ

ありがとう

4

3 に答える 3

3

Fancybox バージョン 1.2.5 は古く、指定したパラメーターをサポートしていません。代わりにこれを使用してみてください。

$(".iframe").fancybox({
    'overlayShow': false,
    'frameWidth': 500, // set the width
    'frameHeight': 100, // set the height
    'type': 'iframe', // tell the script to create an iframe
});
于 2013-05-23T11:43:25.003 に答える
3

このコードは、画像の高さと幅を設定するのに役立ちます

ファンシーボックスに表示したい

$('#viewlogo').live('click', function(){
    $this = $(this);
    $.fancybox({
        'opacity'       :   true,
        'overlayShow'   :   true,
        'overlayColor'  :   '#525252',
        'width'         :   400,
        'height'        :   400,
        'href'          : $this.attr('href')
    });
    return false;
});

<a id="viewlogo"  class="iframe" href="<?php echo $orig_image; ?>"><img class ="printhide"  src="<?php echo $topic_media_URL; ?>" border="1"  width="100" height="100" /></a>

HTML コード

<a id="viewlogo"  class="iframe" href="<?php echo $orig_image; ?>"><img   src="<?php echo $topic_media_URL; ?>" border="1"  width="100" height="100" /></a>
于 2013-05-23T10:36:12.330 に答える
1

このコードを使用してください:

$(".fancybox-wrap").height($(".fancybox-iframe").contents().find("html").height() + 30);
$(".fancybox-skin").height($(".fancybox-iframe").contents().find("html").height() + 30);
$(".fancybox-inner").height($(".fancybox-iframe").contents().find("html").height());
于 2015-06-30T15:37:22.560 に答える