object-fit-polyfill icon indicating copy to clipboard operation
object-fit-polyfill copied to clipboard

Use polyfill for specific classes

Open RazielleS opened this issue 9 years ago • 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

RazielleS avatar Nov 18 '15 11:11 RazielleS

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

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

fregante avatar Mar 28 '16 06:03 fregante