Frame/IFrame scrolling 属性

Frame/IFrame 对象参考手册 Frame/IFrame 对象

定义和用法

scrolling 属性可设置或者返回 frame/iframe 元素中 scrolling 属性的值。

scrolling 属性指定 frame/iframe 是否显示滚动条。

frameObject.scrolling=value

或者

iframeObject.scrolling=value

scrolling 属性可以是以下值:

描述
auto 根据文档的尺寸自动显示滚动条(默认)。
yes 滚动条一直显示
no 滚动条永远不显示


浏览器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要浏览器都支持 scrolling 属性


实例

实例

返回以及设置 scrolling 属性的值:

<html>
<head>
<script>
function removeScroll()
{
document.getElementById("myframe").scrolling="no";
}
</script>
</head>
<body>

<iframe id="myframe" src="//techbrood.com">
<p>Your browser does not support iframes.</p>
</iframe>

<p>The value of the scrolling attribute is:
<script>
document.write(document.getElementById("myframe").scrolling);
</script>
<p>

<input type="button" onclick="removeScroll()" value="Remove Scrollbars">

</body>
</html>

尝试一下 »


Frame/IFrame 对象参考手册 Frame/IFrame 对象