Use 'this' directly, since it's already a jQuery instance.
Cache the result of offset(), since it's an expensive calculation.
Create the  once and re-use it, instead of re-creating it every time.
Use element.getBoundingClientRect() if available, which should be faster since it's a native method.
Added crude benchmarking to measure performance.
Added more div elements to benchmark.
Taking care to respect the positions of *edges* of pixels, with respect to whether or not an edge of a box is visible.
Merge pull request #12 from greim/master

8x performance increase.