How can I stop an IFrame reloading when I change it's position in the DOM?

后端 未结 5 1981
鱼传尺愫
鱼传尺愫 2020-12-15 22:46

Is there any way to stop an Iframe re-loading it\'s contents when I change it\'s position within the DOM? Simple example:



        
5条回答
  •  暖寄归人
    2020-12-15 23:38

    If the ads are a fixed size, you could place them in absolutely-positioned divs instead. Then, once the page loads, you could move those container divs to their designated spots. There are a lot of Javascript samples out there for calculating an absolute position from a relative position. Of course, you would have to reserve space visually in the destination divs so the ads wouldn't cover the content.

提交回复
热议问题