Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
I think that adding this to the original code helps: iframeToWorkOn.height = parseInt(iframeToWorkOn.height) + 50; This adds 25px top and 25px bottom compensating for CSS padding. I also wra...
Answer
#4: Post edited
- I think that adding this to the original code helps:
- ```js
- iframeToWorkOn.height = parseInt(iframeToWorkOn.height) + 50;
- ```
This adds 25px top and 25px compensating for CSS padding.- <hr>
- I also wrapped everything in a `DOMContentLoaded` eventListener:
- ```js
- window.addEventListener('DOMContentLoaded', () => {
- // All code comes here;
- });
- ```
- To make sure that the moment the DOM content is loaded, the iframe would be rendered correctly.
- I think that adding this to the original code helps:
- ```js
- iframeToWorkOn.height = parseInt(iframeToWorkOn.height) + 50;
- ```
- This adds 25px top and 25px bottom compensating for CSS padding.
- <hr>
- I also wrapped everything in a `DOMContentLoaded` eventListener:
- ```js
- window.addEventListener('DOMContentLoaded', () => {
- // All code comes here;
- });
- ```
- To make sure that the moment the DOM content is loaded, the iframe would be rendered correctly.
#3: Post edited
- I think that adding this to the original code helps:
- ```js
- iframeToWorkOn.height = parseInt(iframeToWorkOn.height) + 50;
- ```
- This adds 25px top and 25px compensating for CSS padding.
- <hr>
I also wrapped everything in a `load` eventListener:- ```js
window.addEventListener('load', () => {- // All code comes here;
- });
```
- I think that adding this to the original code helps:
- ```js
- iframeToWorkOn.height = parseInt(iframeToWorkOn.height) + 50;
- ```
- This adds 25px top and 25px compensating for CSS padding.
- <hr>
- I also wrapped everything in a `DOMContentLoaded` eventListener:
- ```js
- window.addEventListener('DOMContentLoaded', () => {
- // All code comes here;
- });
- ```
- To make sure that the moment the DOM content is loaded, the iframe would be rendered correctly.
#2: Post edited
- I think that adding this to the original code helps:
- ```js
- iframeToWorkOn.height = parseInt(iframeToWorkOn.height) + 50;
- ```
This adds 25px top and 25px compensating for CSS padding.
- I think that adding this to the original code helps:
- ```js
- iframeToWorkOn.height = parseInt(iframeToWorkOn.height) + 50;
- ```
- This adds 25px top and 25px compensating for CSS padding.
- <hr>
- I also wrapped everything in a `load` eventListener:
- ```js
- window.addEventListener('load', () => {
- // All code comes here;
- });
- ```