0

私のJavaScriptには、次の関数があります。

$(document).ready(function() {
    var no_of_galleries = $('.gallery').length;
    for ( var i = 1 ; i < no_of_galleries ; i++ ) {
         $("a[rel=photo_open" + i + "]").fancybox();
    }
});

私はすべてを試しましたが、親で開くことはできません。このファイルをiframeで呼び出していますが、iframeではなく親で画像を開きたいです。

解決策がある場合は教えてください。そうでない場合は、親で開くようにfancyboxファイルで何を変更する必要があるか教えてください。

4

1 に答える 1

0

解決しました!

以下を変更します。

351 行目から 'height' : $(document).height() から 'height' : $(window.parent.document).height()

$('body').append( から window.parent.$('body').append( への 1039 行目

674行目から677行目

$(window).width() - (currentOpts.margin *2),
$(window).height() - (currentOpts.margin * 2),
$(document).scrollLeft() + currentOpts.margin,
$(document).scrollTop() + currentOpts.margin

$(window.parent.window).width() - (currentOpts.margin * 2),
$(window.parent.window).height() - (currentOpts.margin * 2),
$(window.parent.document).scrollLeft() + currentOpts.margin,
$(window.parent.document).scrollTop() + currentOpts.margin

それは実際に動作します!!私はそれをテストしました

于 2012-06-08T06:34:59.780 に答える