Loading another site without delay and positioning it correctly using CSS?

荒凉一梦 提交于 2020-01-25 09:29:06

问题


I have an angularjs web application that loads another site within an iframe in a specified div. Internet Explorer 11 loads the angularjs + requirejs so slowly, that I need to wait for around 4 seconds till the other site's loading is triggered (iframe's src injected into the dom).

<html>
  <body>
    <div ng-app="module">
      <!-- happens after 3-4 seconds due to the delay mentioned above-->
      <div id="otherapp">
        <iframe src="https://www.bing.com">
        Another Site
        </iframe>
      </div>
    </div>
  </body>
</html>

I would like to parallelize this by going something like this instead:

<html>
  <body>
    <div id="othersite">
      <!-- loads immediately -->
      <iframe src="https://www.bing.com">
      Other Site
      </iframe>
    </div>
    <div ng-app="module">
      <!-- bring it here either using dom manipulation or css -->
      <div id="othersiteholder">
      </div>
    </div>
  </body>
</html>

Since there is an iframe, I can't move the div element using appendChild. Is there a CSS solution that can be used here as it a positioning problem? Something like:

  1. Create the otherapp div with an absolute position.
  2. The application will create an otherappholder div and leaves some position for this page.
  3. It calculates it offset and repositions the otherapp div.

While this is for an angularjs application, I am looking for a pure CSS based solution for this problem using position: absolute, position: relative etc.

来源:https://stackoverflow.com/questions/50448792/loading-another-site-without-delay-and-positioning-it-correctly-using-css

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!