tuupola/jquery_lazyload — pull request #196 by jvanasco (2014-05-14 22:08:09+00:00)
Title: added `handle_webkit_error` option to `settings`

This addresses the behavior caused by webkit browsers reporting images without width/height as not visible if `skip_invisible` is false. this seems to be a common issue on stack overflow and the comments section of the lazyload website.

reference lazyload website:

HEADS UP! Webkit browsers will report images with without width and height as not .not(":visible"). This causes images to appear only when you scroll a bit. Either fix your image tags or set skip_invisible to false.

if a user has images of unknown dimensions ( like me! ) and wants to skip_invisible ( because they might have tabbed browsing enabled, like me! ), they can pass in `handle_webkit_error : true` to the lazyload settings.

this setting controls the initial `update` that occurs on `document.ready(`. if `handle_webkit_error` is true ( tested first , so we quickly fail in a logical short-circuit ) we check the navigator.appVersion for the string "webkit". if a "webkit" browser is detected, the plugin does a modified initial "update":

* scroll down 1 pixel
* update()
* scroll up 1 pixel

this seems to get past the bug/behavior in webkit.