在wordpress中我使用的是一个创建这个iframe的插件:
<iframe scrolling="no" allowfullscreen="" src="http://...k.jpg&is_stereo=false" width="100%" height="1200px"></iframe>
这是php页面的数组:
$a = shortcode_atts( array(
'img' => '',
'video' => '',
'pimg' => '',
'stereo' => 'false',
'width' => '100%',
'height' => '1200px',
), $atts );
这个PHP代码:
<iframe width="<?php echo $a['width']; ?>" height="<?php echo $a['height']; ?>" scrolling="no" allowfullscreen src="<?php echo $iframe_url; ?>"></iframe>
宽度是完美和响应。
我需要一个全高度的iframe。怎么样?
您可以尝试查看是否有效:
<div style="height: 100%; width: 100%;">
<iframe width="<?php echo $a['width']; ?>" height="<?php echo $a['height']; ?>" scrolling="no" style="height:100%;width:100%" allowfullscreen="1" src="<?php echo $iframe_url; ?>"></iframe>
</div>
输出应该是
<div style="height: 100%; width: 100%;">
<iframe scrolling="no" allowfullscreen="1" src="http://...k.jpg&is_stereo=false" style="height:100%;width:100%" width="100%" height="1200px"></iframe></div>