My webpage features an iframe that needs to be resized dynamically each time its contents change in order to eliminate scrollbars. The content inside the iframe frequently changes without altering the URL. I desire for all the content within the frame to be visible at all times, without causing any screen flickering during the resizing process. Both the parent and the frame are hosted on the same domain.
Currently, I have a function that I call to adjust the frame size whenever I believe it has changed. How can I streamline this process without having to call the function multiple times?
For reference, my website is built using AngularJS.