background-size-polyfill icon indicating copy to clipboard operation
background-size-polyfill copied to clipboard

When is the polyfill executed? How to refresh?

Open codeofsumit opened this issue 9 years ago • 3 comments

I'm building a new framework with the mobile-first, progressive enhancement approach.

Mobile-first means I need to use workarounds for media-queries and for convenience and maintenance, I chose respond.js. I think your polyfill is executing earlier than respond.js, which makes background-images cover the "mobile version" of the elements. Once respond.js hits, most elements are enlarged.

So in order for this polyfill and respond.js working nicely together I need to either load the polyfill after respond.js hits, or I need to refresh the polyfill calculations after respond.js is executed.

Any advice on that one is very much appreciated.

And great work, btw! ;-)

codeofsumit avatar Oct 02 '14 09:10 codeofsumit

resizing the browser window will update the calculations to correctly enlarge the image. Is there any way to force a polyfill-refresh via JS? I could imagine to trigger the browsers resize event (via jQuery for example) but I don't know if the polyfill listens to that event. EDIT: triggering the resize event doesn't seem to work

codeofsumit avatar Oct 02 '14 09:10 codeofsumit

OK, this may be irrelevant. I just tested on a XP machine and everything is fine there. Seems like IE11 in IE8-mode is the problem.

codeofsumit avatar Oct 02 '14 11:10 codeofsumit

I am having this issue in IE 8 on Win 7, it requires a slight resize of the browser for the images to appear

fotisp avatar May 25 '15 11:05 fotisp