2013-02-05 18 views
1

如何在和脚本中执行自动屏幕调整?它们包含到外部网站的链接。<iframe>和脚本中的自动屏幕调整

代码

<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/

上进行放大/缩小的尺寸变化。

+0

为什么不用于I帧使用宽度为100%和使用父宽度,以确定实际宽度? – drodil

+0

我试过100%,但它没有做任何改变...我如何使用父宽度? – remya

+0

这是因为您的帧宽度固定为460px。你需要将其更改为自动 – Sowmya

回答

0

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

+0

谢谢你这么多... :) – remya