Skip to content

Commit

Permalink
Merge pull request customd#1 from SujayKrishna/master
Browse files Browse the repository at this point in the history
Checking the size of the element to detect more factors
  • Loading branch information
Sam Sehnert committed Apr 15, 2013
2 parents ab73276 + ac1a3c8 commit ab5a206
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions jquery.visible.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
_top = $t.offset().top,
_bottom = _top + $t.height(),
compareTop = partial === true ? _bottom : _top,
compareBottom = partial === true ? _top : _bottom;
compareBottom = partial === true ? _top : _bottom,
clientSize = this.offsetWidth * this.offsetHeight;

return ((compareBottom <= viewBottom) && (compareTop >= viewTop));
return !!clientSize && ((compareBottom <= viewBottom) && (compareTop >= viewTop));
};

})(jQuery);
})(jQuery);

0 comments on commit ab5a206

Please sign in to comment.