如何在Magnific Pop-Up中设置弹出式iframe样式?

ver*_*ger 8 magnific-popup

我想在http://chesstao.com/test.php中显示iframe (单击绿色框).但我没有看到一个方法或类来设置iframe的高度和宽度.

HTML: <div>
<a href="games/header-test.php?game=aveskulov" class="my-popup iframe-link">Show iframe popup</a>
</div>
Run Code Online (Sandbox Code Playgroud)

js:

<!--Magnific-popup-->
<script src="//cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/0.8.9/jquery.magnific-popup.min.js" ></script>

<script type="text/javascript"> 

$(document).ready(function() {

$('.iframe-link').magnificPopup({type:'iframe'});

});</script>
Run Code Online (Sandbox Code Playgroud)

css:

.my-popup {height:900px; width:1200px}
Run Code Online (Sandbox Code Playgroud)

如何为巨大的弹出式iframe编写样式(高度和宽度)?我很困惑.上面的风格被忽略了.

cw2*_*w24 10

这不是一个完整的答案,但它可能会有所帮助.

将您的选项更改为以下内容:

$('.iframe-link').magnificPopup({
   type: 'iframe',
   iframe: {
       markup: '<div class="mfp-iframe-scaler your-special-css-class">'+
                        '<div class="mfp-close"></div>'+
                        '<iframe class="mfp-iframe" frameborder="0" allowfullscreen>            </iframe>'+
                    '</div>'
   }   

});
Run Code Online (Sandbox Code Playgroud)

然后在你的css类做这样的事情:

.your-special-css-class {
    max-width: 320px !important;
    height: 85%;
    margin: auto;
    max-height: 780px;
    padding: 140% 16px 0 13px !important;
}
Run Code Online (Sandbox Code Playgroud)

调整高度的重要部分是填充....