/*! 
 * jquery.hasOverflow plugin by Luka Zakrajšek
 * from http://stackoverflow.com/questions/2059743#4219122
 *
 */

(function($){
    $.fn.hasOverflow = function() {        
        var $this = $(this);
        var $children = $this.find('*');
        var len = $children.length;
        
        if (len) {
            var maxWidth = 0;
            var maxHeight = 0
            $children.map(function(){
                maxWidth = Math.max(maxWidth, $(this).outerWidth(true));
                maxHeight = Math.max(maxHeight, $(this).outerHeight(true));
            });
            
            return maxWidth > $this.width() || maxHeight > $this.height();
        } else {
            return false;
        }
    };
})(jQuery);
