protonet/jquery.inview — pull request #10 by rschenk (2012-04-30 16:02:43+00:00)
Title: Add middle

This version of inview was working great for me! There was just one problem...if an element was taller than the viewport, then the "bottom" visiblePart state was being fired as soon as the top edge moved out of the viewport. (And the same for horizontal scrolling with "left" and "right").

While this logic is correct if the element in question is smaller than the viewport, it is not exactly correct if the element is larger than the viewport. To handle this case, I added a fourth state, "middle". The "middle" state is fired if the element is larger than the viewport, it is in view, but the top and bottom (or left and right) edges are out of the viewport. It's like the opposite of "both"