- inViewportTest = function () {
- var winHeight = $(window).height(),
- bottom = winHeight + $(window).scrollTop(),
- top = $(window).scrollTop(),
- thresholdTop = (this.options.threshold * winHeight) + top,
- thresholdBottom = bottom - (this.options.threshold * winHeight);
- if (bottom <= this.offset().top && top >= this.offset().top + this.height()) {
- return false;
- } else {
- return true;
- }
- };