amp html - AMP IFrame is not working in AMP LightBox -
example:-
<amp-lightbox id="my-lightbox" layout="nodisplay"> <div class="lightbox" on="tap:my-lightbox.close" role="button" tabindex="0"> <amp-iframe width="350" height="300" layout="fixed" sandbox="allow-scripts allow-same-origin allow-popups" frameborder="0" src="https://ampbyexample.com/"></amp-iframe> </div> </amp-lightbox> <button class="ampstart-btn caps m2" on="tap:my-lightbox" role="button" tabindex="0">open iframe in lightbox</button>
i tried manipulate position of iframe 75% or 600px top it's not working.
the amp iframe contains jquery ui calendar want use delivery date selected user in our amp page.
is possible , pass value in amp iframe?
if having problems iframe displaying, add placeholder image iframe element. allow circumvent 75%/600px restriction. can add placeholder this:
<amp-iframe width="350" height="300" layout="fixed" sandbox="allow-scripts allow-same-origin allow-popups" frameborder="0" src="https://ampbyexample.com/"> <amp-img layout="fill" src="https://placekitten.com/g/300/300" placeholder></amp-img> </amp-iframe>
updated (added sentence sharing data iframe parent)
if trying send data amp-iframe parent, not work. restriction explained here: https://github.com/ampproject/amphtml/blob/master/spec/amp-iframe-origin-policy.md
Comments
Post a Comment