The author uses jquery in the project. UI. when dialog 1.7.2 is used, $ ("# D") is used "). dialog ("open");, dialog always pops up the position specified in option;
After expansion, the function of "automatically remembering the location when the feature is disabled" is added. The source 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 ()
{
// Determines 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.