We can find scroll width and scroll height of HTML element using element.scrollWidth,  element.scrollHeight. Visible width and height of HTML elements are element.offsetWidth,  element.offsetHeight.  Here we are going to use $event.target as element

Markup

<div ng-click="checkOverflow($event)"> div 1 </div>

Script

$scope.checkOverflow = function($event) {
       if ($event.target.offsetHeight < $event.target.scrollHeight ||
              $event.target.offsetWidth < $event.target.scrollWidth) {
              // your element have overflow
            } else {
              // your element doesn't have overflow
            }
};

0 comments:

Blogroll

Follow this blog by Email

Popular Posts