您的问题不清楚....您是否需要通过单击按钮滚动到页面上的某个点?如果是这样,请使用 scrollWindow/scrollTo 功能,例如:
<html>
<head>
<script type="text/javascript">
function scrollWindow()
{
window.scrollTo(100,500);
}
</script>
</head>
<body>
<input type="button" onclick="scrollWindow()" value="Scroll" />
<p>SCROLL SCROLL SCROLL SCROLL SCROLL SCROLL SCROLL SCROLL</p>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<p>SCROLL SCROLL SCROLL SCROLL SCROLL SCROLL SCROLL SCROLL</p>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<p>SCROLL SCROLL SCROLL SCROLL SCROLL SCROLL SCROLL SCROLL</p>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<p>SCROLL SCROLL SCROLL SCROLL SCROLL SCROLL SCROLL SCROLL</p>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<p>SCROLL SCROLL SCROLL SCROLL SCROLL SCROLL SCROLL SCROLL</p>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<p>SCROLL SCROLL SCROLL SCROLL SCROLL SCROLL SCROLL SCROLL</p>
</body>
</html>
如果要将 iframe 与中心对齐,请使用表格,例如:
<body>
<table width="100%" height="100%">
<tr align="center">
<td align="30px">
<div id="iframe" style="position:relative;overflow:hidden;width:100%; height:100%;">
Insert iframe code here</div>
</td>
</tr>
</table>
</body>