2
I’m automatically bringing information from a database, which creates a scroll in a div. The problem is that I have to scroll down to follow the information that appears on the screen. How would I make the scroll automatically descend with the information, regardless of how much the database brings? I tested this code, but it didn’t work:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<script>
$("#resultados").scrollTop($("#resultados")[0].scrollHeight);
</script>
<div id="resultados" style="overflow: scroll">
Aqui aparece os resultados
</div>
I don’t understand, you could recreate an example of this in Jsfiddle and explain a little better what you’re trying to do?
– Chun
You are adding more than one element with the same ID
#resultados
? view HTML and/or jsFiddle would be good...– Sergio