-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intent to implement: Iframe resizing #728
Comments
👍 |
This sounds a great refinement of the previous behaviour! I was just wondering if this would cope with the situation where
Will it remember the size of the element when you left the page and make sure you are still in the same place or will the element revert to the placeholder size and bump you down the page slightly? |
@johnduffell It very much depends on the browser and on whether an onunload handler is installed. If we can get the analytics people to not do that, we are good :) |
great thanks @cramforce |
Also #814 |
I'm getting an error with this resize implementation:
I'm also getting an undefined error whenever I try to reference window.context (ex: I tried using window.context.requestResize(300,600) to resize my ad). Here's my simple demo page for reference: Can anyone assist on either of these issues? |
@coreybyrnes Could you file a new issue including a repro case. I'd not expect resize to ever succeed on your demo page, because we do not allow resizing of ads that are in the middle of the viewport. |
@cramforce Can you explain further on what the limitations are for ad resize? I'm looking here and don't see any specific rules: https://github.com/ampproject/amphtml/tree/master/ads#ad-resizing |
@coreybyrnes End of that paragraph. I just clarified it slightly. |
@cramforce Can you confirm some findings of mine that, if true, would be helpful to include in the documentation?
|
@coreybyrnes you are correct. This is documented here: https://github.com/ampproject/amphtml/blob/master/extensions/amp-iframe/amp-iframe.md#iframe-resizing /cc @Meggin to see if this is also documented in docs and maybe needs some work. /cc @sriramkrish85 |
@dvoytenko you referenced iframe resizing but I'm specifically inquiring about ad resizing and the documentation isn't clear there. I really think it needs to be more specific and re-worded for clarification. Let me know if I can help with the edit. |
Makes sense. I opened #2594 to track documentation for ad resizing behavior. |
The following applies to both
amp-iframe
,amp-ad
and a futureamp-template
tag.We are planning to allow resource resizing in a way that is not disruptive to UX. In this new world
This represents an alternative strategy to #571 which is only applicable for some use cases. This implements the remaining feature request in #495
Iframes will be able to resize themselves using this piece of JavaScript.
For
amp-template
resizing happens automatically whenauto-resize
is set on the tag and the contents overflow.The following algorithm determines what actually happens upon resize:
document.activeElement
the resize is executed in the next animation frame. This covers all cases where the resize was requested due to user action.CC @rudygalfi
The text was updated successfully, but these errors were encountered: