JS pop-up window plug-in zDialog simple usage example, jszdialog
This article describes the simple usage of the JS pop-up plug-in zDialog. We will share this with you for your reference. The details are as follows:
Because no element can be displayed to framesettings, the following operations are performed on index.htm:
Index.htm
<Script language = "javascript" src = "JS/zDialog. js "type =" text/javascript "> </script> <script language =" javascript "src =" JS/zDialog/zDrag. js "type =" text/javascript "> </script> // introduce the corresponding interface <script language =" javascript "type =" text/javascript "> // on its subpage medium, call this method to open the corresponding interface function openDialog (title, url) {var dlg = new Dialog (); // define the Dialog object dlg. model = true; dlg. width = 500; // define the length of dlg. height = 400; dlg. URL = url; dlg. title = title; dlg. show () ;}</script>
Define an iframe to introduce the corresponding interface:
Copy codeThe Code is as follows: <iframe src = "default.htm" height = "600" width = "100%" frameborder = "0" id = "parentframe" name = "parentframe" marginheight = "0" marginwidth =" 0 "runat =" server "scrolling =" auto "> </iframe>
In the pop-up window that needs to be called, you can write as follows:
Function B (URL, title, id) {set_current (id); top. openDialog (title, URL); // The js method in index.htm is used here}
In other subpages, a prompt box is displayed:
Top. dialog. alert ("prompt successful"); // only top is prompted. dialog. close (); // close the window top. dialog. alert ("prompt successful", function () {top. dialog. close () ;}) // a prompt is displayed. Click OK to close the pop-up window.