我已經做了一些在網絡上尋找你,並有幾個解決方案。最流行的一種似乎是使用JQuery來正確調整iFrame的大小。
到腳本的鏈接在這裏找到:jQuery Responsive iFrame's
<!-- Activate responsiveness in the "child" page -->
<script src="/js/jquery.responsiveiframe.js"></script>
<script>
var ri = responsiveIframe();
ri.allowResponsiveEmbedding();
</script>
<!-- Corresponding code in the "parent" page -->
<script src="/js/jquery.js"></script>
<script src="/js/jquery.responsiveiframe.js"></script>
<script>
;(function($){
$(function(){
$('#myIframeID').responsiveIframe({ xdomain: '*'});
});
})(jQuery);
</script>
從那裏剛剛做出的iFrame有myIframeID
ID或簡單地改變腳本上面的文字,以適應這一點。
如果這不是爲你工作,我會建議使用我的谷歌搜索字符串來尋找其他可能的解決方案:responsive iframe width
祝您好運!
請給我們您的wordpress網站地址,以便我們可以在實際行動中看到問題。 –
您可以同時放置'width =「100%」'和'style =「max-width:100%」'。在你的代碼中,有一個固定的寬度... – designtocode
@msbodetti URL - http://www.getcsr.com/index.php/256-2/ – chiragvora