Allows you to add a class to the data-picture div by specifying a data-class attribute (e.g. <div data-picture data-alt="" data-class="class-name">)
<div data-picture data-alt="" data-class="class-name">
Add data-class support.
Thanks for this, exactly how I thought it should work!
The latest version in master appends the img to the selected source child element, so you can easily target the image through a parent selector if you add classes to your data-src elements. I'm closing this out assuming that'll address your issue, but let me know if there's a case it doesn't cover! Thanks.
I understand I can target the img through its parent selector with a class on it. However I do need to put a class onto the img class in order to make another 3rd party script work. Could you please add this functionality to Picturefill?
I've tried some code committed by another user and it didn't work. It places the class onto the span instead.
Thank you so much.