`
jammy.zhou
  • 浏览: 14652 次
  • 性别: Icon_minigender_1
  • 来自: 广州
文章分类
社区版块
存档分类
最新评论

关于div和textarea的自动scroll

阅读更多
1, div
<div style="width:100%; height:95%; overflow-y:scroll">
<div id="command_result" style="height:90%; width:100%"></div>
<div id="command_result_end" style="overflow:hidden; height:1px"></div>
</div>
<script>
document.getElementById("command_result_end").scrollIntoView();
</script>

2, textarea
var obj = document.getElementById("command_result");
obj.scrollTop=obj.scrollHeight
0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics