More extensive demos & tests #2

Closed
desandro opened this Issue Aug 25, 2011 · 5 comments

Projects

None yet

4 participants

@desandro
Owner

Right now the demo/test exhibits two tests cases: on doc ready, and cloning/appending elements. Are there any other test cases we should consider?

  • Using other images
  • pulling images from Flickr/imgur/instagram API
  • Infinite Scroll
  • Tumblr pages
Contributor

There is some testing infrastructure in here that may be of help https://github.com/peol/jquery.imgloaded/blob/master/qunit/index.html

hmm, normally, using on() and off(), you can bind- and unbind events. How could we unbind the imagesLoaded function? The thing is, in some cases you want to be able to dynamically add the check for the loading of images, and when they're done loading remove the checking.

Collaborator
darsain commented Feb 27, 2012

@michahell imagesLoaded is not an event. It is one time function call that gives you a callback after all images from stack has finished with loading. And when they are done, and callback has been fired, it removes all attached event listeners itself. No need to do that yourself.

I know this, however, the removing of all attached event listeners wasn't happening for some reason. In my implementation, the callback fired +1 times after each time i called the imagesLoaded function somehow. I fixed it now though, was probably something i did wrong :)

Owner

v3 overhaul has tests with Qunit. The demo is pretty solid too. Closing.

@desandro desandro closed this May 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment