protonet / jquery.inview

A jQuery plugin that adds a bindable 'inview' event for detecting when an element is scrolled into view.
blog.protonet.info/post/2516624585/jquery-inview-plugin
Do What The F*ck You Want To Public License
1.67k stars 488 forks source link

use array instead of jQuery "add" method to improve performance #39

Closed robertfausk closed 9 years ago

robertfausk commented 9 years ago

...when creating list with all inview elements cause there is no need to have a sorted element list. This improves performance drastically when very many elements have to be checked, e.g. more than 200. Also removed trailing whitespaces.

From http://api.jquery.com/add/

When all elements are members of the same document, the resulting collection from .add() will be sorted in document order;
that is, in order of each element's appearance in the document.
tiff commented 9 years ago

Thank you!

robertfausk commented 9 years ago

Thank you too for very ultra fast merging. Could you also release a new tag? I think v1.0.1 would be the next step cause there are no changes in api.