BTW: I use Jquery :)
Peter
2010-07-24 17:06:23
It is possible if you add an extra <div>
inside the <div style="overflow: auto">
. We then use this internal div to capture the height of the text. This then allows us to us to check if scrolling is finished. You can see it in action here.
The code itself is below where #parent
is the id I gave to the div in your example:
$(document).ready(function(){
var parent = $('#parent');
var text = $('<div id="text">').text(parent.text());
parent.text('');
parent.append(text);
});
$('#parent').scroll(function(){
if(($(this).scrollTop() + $(this).height()) == $('#text').height())
alert('Done scrolling');
});