Dialog attribute note in Jquery. For details about jquerydialog, refer.
The Code is as follows:
$ ('# DialogDiv'). dialog (
{
Hide: true, // click Close to hide. If this option is not added, an error occurs when the pop-up window is closed.
AutoOpen: false,
Height: 380,
Width: 800,
Modal: true, // masked layer (the pop-up will affect the page size)
Title: 'bidder ',
Overlay: {opacity: 0.5, background: "black", overflow: 'auto '},
Buttons :{
'OK': function (){
// Processing method addUser ();
},
'Cancel': function (){
// Close the current Dialog
$ (This). dialog ("close ");
}
}
}
);
$ ('# AddItems'). click (function (){
Loadpage('buildopeninggroupaddopering.htm', '# dialogDiv'); // enter the dialog page
// Adjust (w.w.parent.doc ument). find ("# projectSpaceContent. show"). height (600) // adjust the current Iframe height
$ ('# DialogDiv'). data ('title. dialog ', 'add bidder'). dialog ('open'); // Modify the title
Return false;
})
Function loadPage (path, id ){
$. Get (path, function (data ){
// Data = data. replace (/ . * <\/Script>/ig, ""); // remove the script tag.
Data = data. replace (/<\/? Link. *>/ig, ""); // remove the link tag
Data = data. replace (/<\/? Html. *>/ig, ""); // remove the html Tag
Data = data. replace (/<\/? Body. *>/ig, ""); // remove the body tag
Data = data. replace (/<\/? Head. *>/ig, ""); // remove the head tag
Data = data. replace (/<\/?! Doctype. *>/ig, ""); // remove the doctype tag
Data = data. replace (/ . * <\/Title>/ig, ""); // remove the title tag.
Upload (id).empty().html (data); // clear contentMain content and load html
});
}
// Add the close button for the pop-up layer
$ ('. Ui-dialog-buttonpane'). show (). empty ();
$ (' Close'). Click (function (){
$ ("# DialogDiv"). dialog ('close ');
Return false;
}). AppendTo ('. ui-dialog-buttonpane ');
Let's take a look at the example first. In addition, if you want to drag or change the dialog size, you need to add ui. draggble. js and ui. resizable. js.
The Code is as follows: