我希望仅在下拉菜单不等于排名或选择位置时才使用 CSS 覆盖值 #bigbox 和 #bigbox-window ...
这是我的第一篇文章,请原谅任何格式错误!谢谢!
<html>
<style>
#bigbox { height:680px; }
#bigbox-window { height:680px; }
</style>
<script language="javascript" type="text/javascript">
function setIframeSource() {
var theSelect = document.getElementById('location');
var theIframe = document.getElementById('myIframe');
var theUrl;
theUrl = theSelect.options[theSelect.selectedIndex].value;
theIframe.src = theUrl;
}
</script>
<body>
<div class="page page-pick_em">
<h1>College Hockey Pick 'Em League</h1>
<form id="form1" method="post">
<label>
<select id="location" onchange="setIframeSource()">
<option value="">Select a location ...</option>
<option value="page/pick_em/standings.html">Standings</option>
<option value="page/pick_em/week01.html">Week 01</option>
<option value="page/pick_em/week02.html">Week 02</option>
</select>
</label>
</form>
<iframe SRC="page/pick_em/standings.html" width="100%" height="80%" id="myIframe" marginheight="0" frameborder="0" onLoad="autoResize('myIframe');"></iframe>
</div>
</body>
<html>