Possible Duplicate:
How to detect overflow in div element?
Is there a cross-browser way to listen to div overflow?
Something like: $('#myDiv').bind("divOverflow", function(){alert('div overflowed!')})
Possible Duplicate:
How to detect overflow in div element?
Is there a cross-browser way to listen to div overflow?
Something like: $('#myDiv').bind("divOverflow", function(){alert('div overflowed!')})
You can do that by comparing scrollHeight with clientHeight.
<script type="text/javascript">
function GetContainerSize ()
{
var container = document.getElementById ("tempDiv");
var message = "The width of the contents with padding: " + container.scrollWidth + "px.\n";
message += "The height of the contents with padding: " + container.scrollHeight + "px.\n";
alert (message);
}
</script>
For more info: How to detect overflow in div element?
You could set an interval and check if the element's scrollHeight > offsetHeight
. There is no built-in event for this.