0

iframe (外部サイトをロードする) の高さを動的に調整する方法はありますか?

また

iframe にスクロールバーが存在するかどうかを確認する方法はありますか?

4

1 に答える 1

0

これを試して:

// Get the iFrame jQuery Object
var $MyFrame = $("#iframeid");

// You need to wait for the iFrame content to load first
// So, that the click events work properly
$MyFrame.load(function () {
    var frameBody = $MyFrame.contents().find('body');

    // Set the iFrame height
    $MyFrame.css({
        height: frameBody.outerHeight()
    });
});
于 2013-04-19T12:42:56.850 に答える