holder icon indicating copy to clipboard operation
holder copied to clipboard

Using holder with <picture> element doesn't work ?

Open thechile opened this issue 7 years ago • 4 comments

Hi, not sure if it me doing something wrong or trying to do something that's not possible.

Using holder with just <img .. > works great. But if i want to do something like below to select the img based on orientation, or use webp with jpeg has the fallback then holder.js doesn't seem to work. Is it possible to have holder.js working in these situations ?

<picture>
    <source media="orientation:landscape" srcset="horizontal-image.jpg" />
    <source media="orientation:portrait" srcset="vertical-image.jpg" />
    <img src="image.jpg" alt="an image" />
</picture>

many thanks

thechile avatar Aug 13 '16 06:08 thechile

could you post a jsfiddle that shows Holder not working?

i don't think there's built-in support, but it's definitely something that should work.

imsky avatar Aug 13 '16 14:08 imsky

Same problem for me...

Fiddle

samtrion avatar Sep 02 '16 11:09 samtrion

If i add text on each srcset, i get the default value... strange :/

Fiddle

samtrion avatar Sep 02 '16 11:09 samtrion

will look at this, maybe worth putting it into v3 along with other general improvements. this may change the general processing logic too much to be a cheap addition.

imsky avatar Sep 06 '16 13:09 imsky