gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 06:04:09 24 4
gpt4 key购买 nike

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

HTML: <div>
<a href="games/header-test.php?game=aveskulov" class="my-popup iframe-link">Show iframe popup</a>
</div>

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>

css:
.my-popup {height:900px; width:1200px}

如何为 magnific popup iframe 编写样式(高度和宽度)?我很困惑。上面的样式被简单地忽略了。

最佳答案

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

将您的选项更改为如下所示:

$('.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>'
}

});

然后在你的 css 类中做这样的事情:
.your-special-css-class {
max-width: 320px !important;
height: 85%;
margin: auto;
max-height: 780px;
padding: 140% 16px 0 13px !important;
}

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

关于magnific-popup - 如何在 Magnific Pop-Up 中设置弹出式 iframe 的样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17912159/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com