Skip to content

Support for <picture> element #17

@brianjacobs-natgeo

Description

@brianjacobs-natgeo

Hi, great library!

In using this I've wanted to use it for images within the <picture> element

Because image-focus looks for the parentElement of an image as the container, styling can get messed up if the parent is a <picture>. This line has worked as a fix for me, bypassing the parent <picture>

this.container = imageNode.parentElement.tagName == "PICTURE" ? imageNode.parentElement.parentElement : imageNode.parentElement;

Alternatively, allow me to explicitly set a container option that would override the default parentElement

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions