louisremi / background-size-polyfill

Adds support for background-size "cover" and "contain" to IE8
http://louisremi.github.com/background-size-polyfill/
MIT License
1.26k stars 359 forks source link

Error when cloning #2

Closed aronwoost closed 11 years ago

aronwoost commented 11 years ago

Some image gallery libraries (namely FlexSlider) clone the first and the last image to make consistent scrolling possible.

Since it's a deep clone (with the wrapped <div> and <img>) this should be possible in theory. However, right after the clone the init() kicks in and the script breaks. For now I hacked the script with a early return when the background-image div has childs (and therefor must have been polyfilled already).

I was unable to create a cleaner solution. You might want to look into it.

Thanks for the great work!

jefferyto commented 11 years ago

Cloning should work in 0.2.0, thanks for the suggestion!

Please reopen (or file a new ticket) if you still get an error.