1

So in my Fancybox I dont want a scrollbar displayed but rather use the autoscale : true option.

So what happens with my settings is that no scroll bar is displayed which is good, but the contents of the div go outside of the white div of the fancybox and the div itself does not grow to size of the content but stays at its original size.

claimLink.fancybox({
        'scrolling' : 'no',
        'overlayShow' : false,
        'autoScale' : true,
        'transitionIn' : 'elastic',
        'transitionOut' : 'elastic',
        'hideOnContentClick' : false,
        'width': 500,
        'height': 590,
        'autoDimensions': false,
        'onCleanup': function (e) {

            var modelClaimFormId = $j(e).attr("href").replace("body", "");
            var modalClaimForm = $j(modelClaimFormId);

            if (!($j(modalClaimForm).valid())) {
                $j(claimForm).remove();
                $j(e).parents("tr").remove();
            }

        }..

Any idea why this is happening ?

4

1 に答える 1

2

'autoScale' : trueビューポートに収まるようにfancyboxを作成することです。それの使用目的です。

特定の固定サイズのfancyboxが必要な場合は、この場合は'width': 500'height': 590設定autoScalefalseます。

一方autoDimensions、コンテンツ自体からfancyboxのサイズを設定(取得)するために使用されます。ただし、そのようなコンテンツにはディメンションが必要です(たとえば、<div>withwidthなどheight)。そうしないと、予期しない結果が発生します...その場合、widthまたはheightfancybox APIオプションを設定する必要はありませんが、コンテンツを表示するautoScaleように設定する必要があります。falseフルサイズでない場合、fancyboxはビューポートに収まるように拡大縮小され、スクロールバーが表示されます。

于 2012-05-24T01:07:09.730 に答える