0

jquery と colorbox ライトボックス プラグインを使用して、ライトボックスで iframe を開きます。

問題は:

  1. ボタンをクリックすると、メインの iframe ライトボックスが開きます
  2. メインの iframe ライトボックス内 - クラス .flash_shareable のボタンがあります
  3. クリックすると、親 (メイン iframe) が閉じられ、リンク先の新しい iframe が開きます。

親iframeを閉じていますが、新しいiframeを開いていません。

私のコード:

$(document).ready(function(){
        var y = $(document.body).height();
        var x = $(document).width();
        parent.$.colorbox.resize({innerWidth:x, innerHeight:y});

        $('.iframe').colorbox({iframe:true}); //ligthbox

        $(".flash_shareable").click(function() {
        parent.$.colorbox.close();
        $.colorbox({href:"faq.html", iframe:true, width:800 + "px", height:600 + "px", open:true});
    })
});

別のライトボックスを開こうとしているiframe の HTML :

<button class="flash_shareable" type="button">open flash</button>
4

1 に答える 1

0

私はそれを修正しましたが、まだ何かが必要だと感じています ^_^ Internet Explorer 8 以下では動作しませ。お願いします :)

$(document).ready(function(){
        var y = $(document.body).height();
        var x = $(document).width();
        parent.$.colorbox.resize({innerWidth:x, innerHeight:y});

        $('.iframe').colorbox({iframe:true}); //ligthbox

        $(".flash_shareable").click(function() {

        $.colorbox({href:"faq.html", iframe:true, open:true});
    })
});
于 2013-01-02T13:16:43.170 に答える