tonipinel/object-fit-polyfill

Use polyfill for specific classes

Opened this issue · 1 comments

Hi there

First thank you for the great work!

I already used this polyfill and it worked great when using the data attribute.

Would it be possible to also include the possibility to use it for arbitrary selectors without specifying the data attribute?
Sometimes there are cases, especially in a CMS, where we can only change a class or a class from an outside element.

It would be great if we could use it for example like this

objectFitPolyfill('.selector .to .image)
// or jQuery version
$('.selector .to .image').objectFitPolyfill()

Thanks, Razrael

With this one you can: https://github.com/bfred-it/object-fit-images

objectFitImages('.selector .to .image');