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

js实现将div等滚动条(scrollbar)保持在最底部的方法

??? 总结了两种方法:

??? 1: div.scrollTop = div.scrollHeight;

??? 2:function?setScrollLeft()?{?

? ? ? ? ?? ? with(window.document.body)?{?

? ? ? ? ? ? ? ? ?? setAttribute("scrollLeft",1024);?

?????????????????? setAttribute("scrollTop",4000);

???????????? }

???? ?? }

?????? setScrollLeft();

参考如下:

? 1:http://www.shenlanit.com/articles/js-javascript-div-keep-scrollbar-button.html

? 2: http://blog.csdn.net/lisliefor/article/details/3393976