Let us be clear with the following definitions.
View - Viewable area or the box containing the content
content - The overflown content.
To detect overflow check for the difference between the view.offsetHeight
and the content.offsetHeight
and your overflown content is this subtracted value.