Frame/IFrame scrolling 属性
 Frame/IFrame 对象
 Frame/IFrame 对象
定义和用法
scrolling 属性可设置或者返回 frame/iframe 元素中 scrolling 属性的值。
scrolling 属性指定 frame/iframe 是否显示滚动条。
frameObject.scrolling=value
或者
iframeObject.scrolling=value
或者
iframeObject.scrolling=value
scrolling 属性可以是以下值:
| 值 | 描述 | 
|---|---|
| auto | 根据文档的尺寸自动显示滚动条(默认)。 | 
| yes | 滚动条一直显示 | 
| no | 滚动条永远不显示 | 
浏览器支持





所有主要浏览器都支持 scrolling 属性
实例
实例
返回以及设置 scrolling 属性的值:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>代码学院(codexy.cn)</title>
<script>
function removeScroll(){
document.getElementById("myframe").scrolling="no";
}
</script>
</head>
<body>
<iframe id="myframe" src="" scrolling="auto">
<p>你的浏览器不支持iframes。</p>
</iframe>
<p>scrolling属性的值为:
<script>
document.write(document.getElementById("myframe").scrolling);
</script>
<p>
<input type="button" onclick="removeScroll()" value="移除滚动条">
<p>IE,Google Chrome,Opera,和Safari 在设置滚动条时会出现问题。</p>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>代码学院(codexy.cn)</title>
<script>
function removeScroll(){
document.getElementById("myframe").scrolling="no";
}
</script>
</head>
<body>
<iframe id="myframe" src="" scrolling="auto">
<p>你的浏览器不支持iframes。</p>
</iframe>
<p>scrolling属性的值为:
<script>
document.write(document.getElementById("myframe").scrolling);
</script>
<p>
<input type="button" onclick="removeScroll()" value="移除滚动条">
<p>IE,Google Chrome,Opera,和Safari 在设置滚动条时会出现问题。</p>
</body>
</html>
尝试一下 »
 Frame/IFrame 对象
 Frame/IFrame 对象			
						
			
 JavaScript 教程
JavaScript 教程 JavaScript 对象
JavaScript 对象 jQuery 教程
jQuery 教程 JSON 教程
JSON 教程 AngularJS 教程
AngularJS 教程 Angular 2 教程
Angular 2 教程 Vue.js 教程
Vue.js 教程 React 教程
React 教程 jQuery UI 教程
jQuery UI 教程 jQuery EasyUI 教程
jQuery EasyUI 教程 AJAX 教程
AJAX 教程 Highcharts 教程
Highcharts 教程 Google Maps API 教程
Google Maps API 教程 ES6 教程
ES6 教程 TypeScript教程
TypeScript教程 ES6 标准入门
ES6 标准入门