JQuery cxDialog dialog box, jquerycxdialog
CxDialog is a jQuery-based dialog box plug-in that supports custom appearance styles and Zepto compatibility for ease of use on mobile terminals.
- Version:
- JQuery v1.7 + | Zepto v1.0 +
JQuery cxDialog v1.2.2
Github address
* Compatible with Zepto and supported by the data module
Online instance
Basic instance preview example
Instance preview content settings
Instance preview and add button
Instance preview appearance style
Instance preview API
Instance preview supports AMD specifications
Instance preview compatible with Zepto
Default Effect
- $. CxDialog ('Hello World! ');
Copy Modal Dialog Box
$.cxDialog({
title: 'cxDialog',
Info: 'Welcome to the cxDialog dialog box! ',
lockScroll: true,
background: '#000'
});
Copy usage to load CSS files
- <Link rel = "stylesheet" href = "jquery.cxdialog.css">
Copy and load JavaScript files
<script src="jquery.js"></script>
<script src="jquery.cxdialog.js"></script>
Copy and call cxDialog
$. CxDialog ('content ');
$. CxDialog ('content', function (){
// click ok callback
}, function(){
// click no callback
});
$.cxDialog({
Title: 'title ',
Info: 'content ',
ok: function(){
// code
},
no: function(){}
});
Copy to set global default value
- $. CxDialog. defaults. title = 'hup ';
Copy parameter description
Name |
Default Value |
Description |
Title |
'' |
Title |
Info |
'' |
Content. It can be set to text content or DOM element. |
OK |
Null |
Callback function when you click OK |
OkText |
'Confirmed' |
Text displayed by the confirm button |
No |
Null |
Callback function when you click Cancel |
NoText |
'Taobao' |
Text displayed by the cancel button |
Buttons |
[] |
Custom button |
CloseBtn |
True |
Show close button |
LockScroll |
False |
Lock scroll? |
BaseClass |
'' |
Add a class to the dialog box container without overwriting the default class. |
Background |
'' |
Specifies the color of the background to be masked. It can be set to a color value in the format of HEX or RGBA, or a value supported by the CSS background attribute. If you do not need to mask the background, set it to false. |
Width |
0 |
Fixed width of the prompt box |
Height |
0 |
Fixed height in the prompt box |
ZIndex |
0 |
Level of the prompt box |
Buttons Parameters
Name |
Description |
Text |
Text displayed by the button |
Callback |
Callback Function |
API
Name |
Description |
$. CxDialog. close () |
Close dialog box |
Download