HTML DOM Cadre / IFrame propriété défilement
Définition et utilisation
défilement propriété définit ou retourne le cadre / élément iframe propriété défilement.
défilement attribut spécifie la scrollbar frame / iframe est affiché.
frameObject.scrolling=value
或者
iframeObject.scrolling=value
或者
iframeObject.scrolling=value
attribut scrolling peut avoir les valeurs suivantes:
值 | 描述 |
---|---|
auto | 根据文档的尺寸自动显示滚动条(默认)。 |
yes | 滚动条一直显示 |
no | 滚动条永远不显示 |
support du navigateur
Tous les principaux navigateurs prennent en charge la propriété de défilement
Exemples
Exemples
Renvoie la valeur de la propriété et définir le défilement:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
<script>
function removeScroll(){
document.getElementById("myframe").scrolling="no";
}
</script>
</head>
<body>
<iframe id="myframe" src="http://www.w3big.com" 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>本教程(w3big.com)</title>
<script>
function removeScroll(){
document.getElementById("myframe").scrolling="no";
}
</script>
</head>
<body>
<iframe id="myframe" src="http://www.w3big.com" 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>
Essayez »
Structure / objets iFrame