首页 > 解决方案 > 自动调整使用脚本创建的区域的大小

问题描述

起初我不是程序员,但在某种程度上可以方便地调整代码。并不总是成功的。:-)

我有以下javascript:

<script type='text/javascript' 
         src='http://knvbwidget.sportlink.com/widget_js.php?soort=team-liggend&clubcode=xxxxxxx&height=1000&width=800'> 
</script>
<script type='text/javascript'>
    showWidget();
</script>  

它以某种格式显示足球队的结果。如您所见,您可以设置高度和使用。

我想让这个自动调整,特别是高度。这可能吗?

我在 Wordpress 页面中使用此脚本。

提前致谢。

标签: javascriptautoresize

解决方案


I would then investigate the resulting document element(s). If e.g. some classes (lets say class="widget") or ids are added to the elements, you can add CSS code that modifies the behavior of those elements. e.g.

.widget {
    width: 100%;
    height: auto;
}

推荐阅读