我正在页面上加载 iFrame:
<div style="width: 800px; height: 500px; overflow: hidden">
<iframe src="https://mypage.com" width="900px" style="position: relative; left: -6%; top: -8%"></iframe>
当 iframe 加载时,它包含:
<div id="overlap-root" style="position: absolute; z-index: 150; top: 0px; left: 0px;"></div>
但是这个 div 里面不会有任何东西,但是根据用户交互会出现一个弹出对话框,这个 div 可以加载一些类,如:
<div data-id="SSSearch" style="position: relative; z-index: 35;">
<div class="_dialog-nonmodal ui-draggable" style="width: 750px; z-index: 110; left: -46px; top: 49px;">
<div class="_dialog-error">
问:有什么方法可以检测这些类的负载吗?我试图在弹出对话框出现时更改 iframe 的高度,并在弹出窗口消失时恢复正常大小。