You need to sign in to do that
Don't have an account?
Aruna Vasahan
Iframe inside lightning component
Hi guys,
I have a visualforce page which I am embedding inside a lightning component using iframe. The code is
I have a visualforce page which I am embedding inside a lightning component using iframe. The code is
<aura:component implements="force:lightningQuickAction,force:hasRecordId" access="global"> <iframe src="{! '/apex/vf_page?Id=' + v.recordId }" width="100%" height="1000px;" frameBorder="0"/> </aura:component>I need the iframe to fit all the contents of the visualforce page without setting width and height to iframe. Do anyone have solution for this?
Please give a try with sample code below which should do the trick.
Add this to your <head> section: And change your iframe to this: For more information please check with below links.
- http://javascript.bigresource.com/IFrame-Auto-Height-Resizer-based-on-its-Content--mJFsvv59.html#k42pWiqcV
- http://stackoverflow.com/questions/819416/adjust-width-height-of-iframe-to-fit-with-content-in-it
Hope this helps.Regards,
Nagendra.
Only after going through the above solution I came here to post the question. The above coding can be used only for javascript pages and there too it doesn't worked for me. The above code is moving only the vertical scrollbars so it doesn't works.
Thanks
Aruna