After expansion, the function of "automatically remembering the location when the feature is disabled" is added. The source code is as follows:
CopyCode The Code is as follows: // myjquery. UI. Dialog. ex. js
////////////////////////////////////
// Automatically remember the location when jquery. UI. dialog is disabled
///////////////////////////////////
(Function ($ ){
VaR originclose = $. UI. Dialog. Prototype. close;
$. UI. Dialog. Prototype. Close = function ()
{
// Determine whether this function is specified in option, such as $ ("# D"). Dialog ({rememberposition: false });
If (this. Options. rememberposition! = False)
{
This. Position = This. uidialog. offset ();
VaR Top = $ ('body'). scrolltop ();
If (Top = 0) Top = $ (document). scrolltop (); // corrected! Doctype bug
VaR left = $ ('body'). scrollleft ();
If (Left = 0) Left = $ (document). scrollleft (); // corrected! Doctype bug
This. Options. Position = [This. position. Left-left, this. position. Top-top];
}
Originclose. Apply (this, arguments );
};
}) (Jquery );
The principle is very simple and no special instructions are provided. If you have such requirements, please refer to it.