用js控制overflow="hidden"
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了用js控制overflow="hidden"相关的知识,希望对你有一定的参考价值。
<html>
<head>
<style type="text/css">
div
{
border:thin solid green;
width:100px;
height:100px;
}
</style>
<script type="text/javascript">
function hideOverflow()
{
document.getElementById("div1").style.overflow="hidden";
}
</script>
</head>
<body>
<div id="div1">
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
</div>
<br />
<input type="button" onclick="hideOverflow()" value="Hide overflow" />
</body>
</html>
以上是关于用js控制overflow="hidden"的主要内容,如果未能解决你的问题,请参考以下文章