desandro/imagesloaded — pull request #44 by avish (2012-12-16 15:22:45+00:00)
Title: Use named functions for image handlers to allow multiple bindings and unbindings.

Currently imagesLoaded relies on a namespace to unbind the event handlers for 'load' and 'error' that it attaches. However, multiple invocations of imagesLoaded that affect the same image will still conflict, where one invocation could remove the event handlers attached by another.

This pull request fixes this behavior by using a named function variable for binding and unbinding, thus assuring that each invocation removes only the event handlers created by it.