bbc / Imager.js

Responsive images while we wait for srcset to finish cooking
Apache License 2.0
3.84k stars 224 forks source link

Enable IE7 Support #102

Closed lewiscoulson closed 9 years ago

lewiscoulson commented 10 years ago

Requirements for the project i'm currently working on changed at last minute and now include support for IE7. By changing the implementation of querySelectorAll as per - https://gist.github.com/icodeforlove/868532 Imager.js can work in IE7. Might be handy for other Developers who find themselves in a similar situation.

thom4parisot commented 10 years ago

Hello @lewiscoulson :-)

Thanks for this contribution! :-)

Is there anything preventing you to assign this proposed function to HTMLElement.prototype.querySelectorAll ?

I would like to support older browsers but I would not like the library size to carry too much useless code for modern browsers.

Integralist commented 10 years ago

@oncletom I don't believe IE7 allows you to bind to HTMLElement :-(

thom4parisot commented 10 years ago

OK I see :-(

thom4parisot commented 9 years ago

Hello @lewiscoulson,

I will not merge this PR for several reasons:

In your case, you could simply do this to make it work with Imager:

var imgr = new Imager(querySelectorAll('.responsive-img'));

// with jQuery
var imgr = new Imager(jQuery('.responsive-img'));

// with jQuery aliased as $
var imgr = new Imager($('.responsive-img'));

Let us know how it goes for you :-)

lewiscoulson commented 9 years ago

Hey @oncletom

No worries, thanks for the feedback :)