Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 29th, 2012  |  syntax: None  |  size: 0.48 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. inViewportTest = function () {
  2.         var winHeight = $(window).height(),
  3.             bottom = winHeight + $(window).scrollTop(),
  4.             top = $(window).scrollTop(),
  5.             thresholdTop = (this.options.threshold * winHeight) + top,
  6.             thresholdBottom = bottom - (this.options.threshold * winHeight);
  7.  
  8.         if (bottom <= this.offset().top && top >= this.offset().top + this.height()) {
  9.             return false;
  10.         } else {
  11.             return true;
  12.         }
  13.     };