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

Dynamically setting background-image: none still displays image #13

Closed gmcnaughton closed 11 years ago

gmcnaughton commented 11 years ago

If an element starts with background-image: url(...) but javascript later sets it to background-image: none, the original image still displays.

My workaround was to add img.style.visibility = "hidden"; to ln 138 (in the else clause of refreshBackgroundImage, when the src cannot be parsed).

jefferyto commented 11 years ago

Thanks for submitting this! 0.2.0 should handle background-image: none set from JavaScript; please reopen (or file a new ticket) if you find it doesn't.