开发者

Can you execute Fancybox during the page "onUnload" event?

That pretty much sums it up! I'm trying to use a stylized "e开发者_开发问答xit popup" instead of the standard Javascript prompt box. Any advice?


This prbably the best you can do:

function unload(){
$.fancybox('<div>alalalala<div>', {
    'titlePosition'     : 'inside',
    'transitionIn'      : 'none',
    'transitionOut'     : 'none'
});
}
$(document).ready(function() {
   window.onbeforeunload=function() {
   unload();
   };
});

I think you cannot prevent the page to unload butyou can ask before if user wishes to leave or stay and in the meantime open the fancybox.

K

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜