Beautiful and super-useful pop-up layer event class JS code, support a variety of dialog boxes, pop-up layer, etc., the pop-up layer can be dragged and dragged smoothly, the browser is well-compatible. Customizable content, headings, widths, buttons, and bindings correspond to the event of a simple and convenient implementation of the elastic layer, to add data or display detailed information and other functions.
Follow my steps below.
(1) Prepare the content to be displayed, which is not just the content, it can also be HTML code
(2) After preparing the content, remember to give it a loud title, clear the subject, of course, you can not need
(3) Do you feel that sometimes it is not necessary to identify and cancel these two guys, and if you don't use them, you can abandon them, not fill them out.
is not very simple, still waiting for what, come and try it!!
The effect is as follows:
The following is an example tutorial:
Popupdiv (Options)
Contents
- Popupdiv (Options)
- Id
- Title
- Width
- Height
- Content
- Ckbtntext
- Normaltext
- Readyfn
- Okfn
- Closefn
- Closemainfn
ID
The ID of the bomb layer
title
The title of the bomb layer
width
The width of the elastic layer
Height
Height of the projectile layer
content
The content of the projectile layer
Ckbtntext
Confirm Button text content
Normaltext
Cancel Button text content
readyfn ()
Subsequent actions performed after the popup layer
Example:
var pd_detail = new Popupdiv ({
Title: "Caption",
width:400,
Okbtntext: "OK",
Normaltext: "No",
Content: "Contents",
Readyfn:function () {
Alert ("Follow-up actions performed after the popup layer");
}
});
Display effect:
OKFN ()
Determining Callback Events
Example:
var pd_detail = new Popupdiv ({
Title: "Caption",
width:400,
Okbtntext: "OK",
Normaltext: "No",
Content: "Contents",
Okfn:function () {
Alert ("OK callback event");
}
});
Display effect:
Closefn ()
Click No for subsequent actions
Example:
var pd_detail = new Popupdiv ({
Title: "Caption",
width:400,
Okbtntext: "OK",
Normaltext: "No",
Content: "Contents",
Closefn:function () {
Alert ("Click to no Follow up");
}
});
Display effect:
CLOSEMAINFN ()
Follow-up operation after closing the projectile layer
Example:
var pd_detail = new Popupdiv ({
Title: "Caption",
width:400,
Okbtntext: "OK",
Normaltext: "No",
Content: "Contents",
Closemainfn:function () {
Alert ("Follow-up operation after the shell is closed");
}
});
Display effect:
Example:
var pd_detail = new Popupdiv ();
Display effect:
Example:
var pd_detail = new Popupdiv ({
Title: "",
Okbtntext: "",
Normaltext: "",
Content: "",
});
Display effect:
:
JavaScript Layer Control
Http://www.tiaoceng.com/assemblydetail_34.html
The elastic layer control based on jquery extension