0

在网页上加载所有内容后如何显示覆盖元素?我不知道在“DOM”加载后该怎么称呼它?或文件准备好了吗?请填写

我正在使用来自该站点的 jquery 插件:http://jquerytools.org/documentation/overlay/ 该站点上的示例显示了如何显示覆盖,但仅在单击某些内容后我想知道如何在所有事情之后立即显示已加载只是为了制作带有登录覆盖的登录页面。

提前谢谢。

4

1 回答 1

1

in jquery you can use

$(document).ready(function () {
   //do what ever
});

or if you want you can use pure javascript like this

window.onload = function(e){ 
    //do something
}

they both do and mean the same thing. When the page elements are finished loading, like divs span, p tags and text.. do something.. this is needed because like in your case you have a div you want to show like an overlay, but if you don't wait until everything is loaded that div may not exist when your javascript wants to show it.

于 2012-07-03T06:24:16.023 回答