jonobr1 / stalactite

stalactite is a jQuery plugin that packs child elements together.
http://jonobr1.github.com/stalactite
154 stars 32 forks source link

Support for divs #1

Closed jgv closed 12 years ago

jgv commented 12 years ago

I've added support for

elements. Excluding support for
might be a choice you made explicitly and if so you can disregard this pull request. I recently wanted to use this plugin but all my images were background images in divs so it wasn't working. Let me know what you think. This commit also fixes a missing comma on line 91.

jonobr1 commented 12 years ago

That's really interesting. I didn't realize that the load listener worked for background images. Should we just call load on all children?

jgv commented 12 years ago

It seems to be working on the app that I'm developing now– Backbone 0.5.3 and jQuery 1.7.1. I guess if .load() works with background images then calling load on all children should work. Maybe .load() is working in my instance because the elements are getting inserted into the dom from Backbone? Haven't tried using this on static html with background images yet.

jonobr1 commented 12 years ago

hmmm interesting. I don't think Backbone is doing that much ;)

I'll make a static test, post up here and keep you posted!

jgv commented 12 years ago

Sounds good!

jonobr1 commented 12 years ago

Okay so I merged it in. I added a test in /t/ in the project. Maybe I'm being stupid going about this, but I can't seem to get load to trigger based on background-image. Maybe I haven't give Backbone enough credit...

Anyways, example is here