您可以通过将scrollHeight与clientHeight进行比较轻松地做到这一点,请尝试以下 *** 作:
<script type="text/javascript">function GetContainerSize (){ var container = document.getElementById ("tempDiv"); var message = "The width of the contents with padding: " + container.scrollWidth + "px.n"; message += "The height of the contents with padding: " + container.scrollHeight + "px.n"; alert (message);}</script>
有关更多信息,请查看:http :
//help.dottoro.com/ljbixkkn.php
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)