Skip to content

Resize events only work if iframe in viewport #10

@luwes

Description

@luwes
Contributor

The solution of top:-100%; and margin:1px 0 0; does not keep the iframe positioned in a viewable area at all times. If the target element is nested in an element with overflow: hidden and the target element has a negative top margin or a negative absolute positioned top the resize events stop working.

top: 0; z-index: -1 seems to fix the issue but I'm not sure what all the consequences are.

Activity

developit

developit commented on Jun 13, 2019

@developit
Owner

Possible solution might be to use position:fixed and the z-index? It'll still be clipped, but being in a new stacking context will make it so browsers can't guarantee it's out of viewport.

luwes

luwes commented on Jun 26, 2019

@luwes
ContributorAuthor

Thanks! Unfortunately we don't use it anymore in the Vimeo player.
A sweet fix if that works though!

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @developit@luwes

        Issue actions

          Resize events only work if iframe in viewport · Issue #10 · developit/simple-element-resize-detector