Add data-class support. #61

Closed
wants to merge 1 commit into
from

Projects

None yet

4 participants

@gilbitron

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">)

@gilbitron gilbitron Add data-class support.
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">)
6ddcf85
asimpson commented Jun 3, 2013

Thanks for this, exactly how I thought it should work!

Owner

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.

@scottjehl scottjehl closed this Jun 6, 2013

Hi Scott,

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment