如何使用自定义页面替换弹出窗口的默认页面 [英] How to replace the default page leaving popup with a custom one

查看:109
本文介绍了如何使用自定义页面替换弹出窗口的默认页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我要求在离开或关闭浏览器之前显示自定义弹出窗口。我试过'window.onbeforeunload'方法。但它始终显示默认弹出窗口。你能帮我看一下自定义弹出窗口。

Hi,

I have a requirement that to display a custom popup before leave or close a browser. I've tried with the 'window.onbeforeunload' method. But it always showing the default popup. Could you please help me show a custom popup.

推荐答案

我担心,没有这种方法可以显示自定义弹出窗口。但你可以在弹出窗口上添加自定义消息。



否则你可以选择这里描述的另一种解决方法 - 创建Jquery Exit Popup [ ^ ],用于播放位置。实现,如果它满足你的要求。

I am afraid, there is no such way to show a custom popup. But you can add custom message on that popup.

Else you can go for another workaround described here - Creating a Jquery Exit Popup[^], which plays with the cusrsor position. Implement, if it satisfies your requirement.
引用:

相反,一种不那么讨厌的方法就是使用Jquery以及当用户光标到达页面顶部时,通常是用户要关闭网页的标志,将弹出一个Jquery灯箱。

Instead a less annoying way of doing this would be to use Jquery and when the users cursor reaches the top of the page, usually a sign that the user is going to close the webpage, a Jquery lightbox will popup.


这篇关于如何使用自定义页面替换弹出窗口的默认页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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