日期:2014-05-16 浏览次数:20313 次
<div id="infodiv" style="border:1px solid red;height:400px;overflow:scroll;"></div> <input id="text1" /><input type="button" id="btnsend" value="send" onclick="sendmsg()" />
------解决方案--------------------
<div id="textdiv" style="position: relative">
<div id="innertext" style="position: absolute">
<span>123</span>
<span>321</span>
</div>
</div>
<script>
var innerText = document.getElementById( 'innertext' ),
text = document.getElementById( 'textdiv' ).getElementsByTagName( 'span' ),
height = innerText.offsetHeight - text[ text.length - 1 ].offsetHeight
innerText.style.top = height;
</script>
大概这样吧 滚动自己做一下