JQuery cxDialog dialog box, jquerycxdialog

Source: Internet
Author: User

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
  1. $. CxDialog ('Hello World! ');
Copy Modal Dialog Box
  1. $.cxDialog({ 
  2.   title: 'cxDialog', 
  3. Info: 'Welcome to the cxDialog dialog box! ',
  4.   lockScroll: true, 
  5.   background: '#000' 
  6. });
Copy usage to load CSS files
  1. <Link rel = "stylesheet" href = "jquery.cxdialog.css">
Copy and load JavaScript files
  1. <script src="jquery.js"></script> 
  2. <script src="jquery.cxdialog.js"></script>
Copy and call cxDialog
  1. $. CxDialog ('content ');
  2.  
  3. $. CxDialog ('content', function (){
  4.   // click ok callback 
  5. }, function(){ 
  6.   // click no callback 
  7. }); 
  8.  
  9. $.cxDialog({ 
  10. Title: 'title ',
  11. Info: 'content ',
  12.   ok: function(){ 
  13.     // code 
  14.   }, 
  15.   no: function(){} 
  16. });
Copy to set global default value
  1. $. 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

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.