开发者

Javascript/jQuery: does anybody already created a loading fixed div on top 100%:100% of the page with jquery?

i used sometimes a 'loading' method with the javascript onload & onunloadbody events.(www.restaurantebarocortico.com)

Now i'm learning jQuery, and i used the $(document).ready & $(window).unload to replace the old events, but the unload event isn't working correctly. Does anybody knows another method to call a function on unload? And, if needed, a method to break the unload and do some effect (, i will need this to put an effect showing the loading div on unload).

the flow of the loading div:

  • it appears on the top of everything (without effect) with an ajax-loader gif at the middle center.
  • when document is ready, hide it with jQuery function (slow effect)
  • when document/window is unloading, show it with jQuery function (slow effect again), and break for a while the event (or sleep the time of the effect).

Tha开发者_运维知识库nks and sorry my english :P José Moreira


You cannot prevent an unload or beforeunload event. If you could, people would abuse it to make tabs unclosable.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜