1

I have an iframe inside a modal but when I open the model the iframe in it is not showing the beginning of the page but the middle.

<iframe name="finance" id="finance" src="https://www.elbtools.com/secure/apply.php?elbt=1459262273170" frameborder="0" border="0" cellspacing="0" style="width:100%; height: 700px;"></iframe>

This is my codepen. Thanks.

Labanino
  • 3,902
  • 9
  • 33
  • 51
  • 1
    What browser are you seeing this issue in? On OSX, it loads correctly in Chrome, Safari, and Firefox. – RustyDev Jun 25 '18 at 21:03
  • I see the issue on Windows 10 using Chrome. – Chris Jun 25 '18 at 21:07
  • It appears to be caused by the iframe being loaded while hidden. You could perhaps create the iframe through javascript when the modal button is displayed. webjunior's answer works for me too though. – Chris Jun 25 '18 at 21:13
  • The issue is with Chrome. Firefox runs fine. – Labanino Jun 26 '18 at 00:06

1 Answers1

5

A quick solution (edited codepen) is to append "#" at the end of your iframe src.

src="https://www.elbtools.com/secure/apply.php?elbt=1459262273170#"

Hope you can modify it until you find better solution.

webjunior
  • 137
  • 7
  • Usually, "#" symbol serves as an anchor to the section of the page. E.g. `mydomain.com/article.html#part3` So, if no anchor is provided, then it will default to top of the page. Also, some info around it here: https://stackoverflow.com/questions/2800187/what-is-it-when-a-link-has-a-pound-sign-in-it P.S. If this solution serves your need, then great :) – webjunior Jun 26 '18 at 19:19