javascript - How to make scroll keep down, but don't want to lock -


i making shoutbox. want when retrieves data keep scroll down. in facebook scroll keep remains down. using javascript goes lock, prevent scroll top. using code :

document.getelementbyid('txthint').scrolltop = 10000;    <div id="txthint" style="width:700px;height:500px;overflow:auto;" > <!-- here data displayed --> </div> 

the problem that, prevents me scrolling up.

try using offsettop property. suggest putting hidden div @ end of div in text scroll down(hidden div should alwasy @ bottom), , should apply scrolltop

document.getelementbyid('txthint').scrolltop = document.getelementbyid('s_hidden').offsettop;    <div id="txthint" style="width:700px;height:500px;overflow:auto;" > <!-- here data displayed --> <div id="s_hidden"></div> </div> 

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -