【问题标题】:Auto screen adjustment in <iframe> and scripts<iframe> 和脚本中的自动屏幕调整
【发布时间】:2013-02-05 06:43:56
【问题描述】:

如何在&lt;iframe&gt; 和脚本中进行自动屏幕调整?它们包含指向外部网站的链接。

&lt;iframe&gt;代码

<iframe id="tmc-ticker" src="http://themoneyconverter.com/AUD/RateTicker.aspx" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" height="30px"  width="460px" style="float:left; margin:-1px 0px 0px 4px;"></iframe>

脚本

<script>
var width='460';
var profile='CMSForexWebQuotes1-B';
</script>
<script id="vtCurrencyPairs" src="http://webcharts.fxserver.com/pairs/js/addActivePairs.js">/**/</script>
<div> <a href="http://www.cmsfx.com"></a> </div>

请看网站:http://hannahsclinic.com/salaamforex/

在放大/缩小尺寸变化时。

【问题讨论】:

  • 为什么不对 iframe 使用宽度 100% 并使用父宽度来确定实际宽度?
  • 我已经尝试了 100% 但它没有做出任何改变...我如何使用父宽度?
  • 那是因为你的框架宽度固定为 460px。您需要将其更改为自动

标签: php html css iframe


【解决方案1】:

var width='460'; 更改为 var width='100%';。与 iframe width="100%" 相同

<script>
var width='100%';
var profile='CMSForexWebQuotes1-B';
</script>

DEMO

<div class="cmsfxWidgetWrapper" style="width: 460px; height: 346px;">

在上面的代码中删除width:460px并使其成为width:auto

【讨论】:

    猜你喜欢
    • 2014-02-05
    • 2023-03-03
    • 1970-01-01
    • 2019-08-22
    • 2013-05-07
    • 1970-01-01
    • 1970-01-01
    • 2012-02-11
    • 2023-01-04
    相关资源
    最近更新 更多