日期:2014-05-16  浏览次数:20401 次

如何让文本域滚动条到最下边的时候,按钮可按
想做个类似魔兽世界用户条例那种界面,把滚动条拉到最下边确定按钮才可以按.请各位达人指点一下.

------解决方案--------------------
<script>
function doit(){
t = document.form_name.ta.scrollTop;
h = document.form_name.ta.scrollHeight;
c = document.form_name.ta.clientHeight;
if((h-t) <=c) document.form_name.bt.disabled = false;
}
</script>
<form name= "form_name ">
<textarea name= "ta " rows= "5 " onscroll= "doit() ">
a
a
s
d
df
dsf
d
fdf
dsf
d
fd
</textarea>
<input type= "button " name= "bt " disabled= "true " value= "xxxxx ">
</form>