HTML DOM スクロール属性

定義と用法

scrolling 属性は、iframeにスクロールバーを持つかどうか(スクロールポリシー)を設定または返します。

文法

iframeObject.scrolling=auto|yes|no

以下の例では、iframeのスクロールバーを追加および削除できます:

<html>
<head>
<script type="text/javascript">
function addScrollbars()
  {
  document.getElementById("frame1").scrolling="yes";
  }
  function removeScrollbars()
  {
  document.getElementById("frame1").scrolling="no";
  }
</script>
</head>
<body>
<iframe src="frame_a.htm" id="frame1"></iframe><br />
<input type="button" onclick="addScrollbars()" />
value="Add Scrollbars" />
<input type="button" onclick="removeScrollbars()" />
value="Remove Scrollbars" />
</body>
</html>