To do a background, edit the function of the article, product requirements, when the user click on the edit window to modify and not save, click anywhere outside the editing window to block the default event, pop-up window allows the user to choose whether to save and then execute the default event.
Think about it. There is no good solution, ask for a way of thinking.
The main problem is not to close the browser trigger box, but to click on the page of the non-editing window part of the trigger, and these parts have a variety of binding events, links and so on.
Reply content:
To do a background, edit the function of the article, product requirements, when the user click on the edit window to modify and not save, click anywhere outside the editing window to block the default event, pop-up window allows the user to choose whether to save and then execute the default event.
Think about it. There is no good solution, ask for a way of thinking.
The main problem is not to close the browser trigger box, but to click on the page of the non-editing window part of the trigger, and these parts have a variety of binding events, links and so on.
The original idea is to be able to add a lost focus event to the editing window, bounce out of the definition confirm, according to the choice of confirm to determine whether to execute the default event, the result is abandoned ...
Finally, you can only add a judgment method to each link and event, passing in the default execution function as the callback parameter
Like this
首页
Switch
确认离开?
是否首页
A very popular dialog box plugin,
Http://aui.github.io/artDialo ...
Listening for browser shutdown events
Is it okay to bind the onblur event to the editor?