如何在加载iFrame时显示加载消息? [英] How to display loading message when an iFrame is loading?

查看:102
本文介绍了如何在加载iFrame时显示加载消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个加载第三方网站的iframe,加载速度极慢。

I have an iframe that loads a third party website which is extremely slow to load.

有没有办法在iframe加载时显示加载消息用户看不到大的空格?

Is there a way I can display a loading message while that iframe loads the user doesn't see a large blank space?

PS。请注意,iframe是针对第三方网站的,所以我无法修改/在他们的页面上注入任何东西。

PS. Note that the iframe is for a third party website so I can't modify / inject anything on their page.

推荐答案

我已经完成了以下css方法:

I have done the following css approach:

 <div class="holds-the-iframe"><iframe here></iframe></div>


 .holds-the-iframe {
  background:url(../images/loader.gif) center center no-repeat;
 }

这篇关于如何在加载iFrame时显示加载消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆