Jquery plug-in jquery. confirm pop-up confirmation message _ javascript skills

Source: Internet
Author: User
This article introduces the plug-in jquery. the confirm pop-up confirmation message implementation method. Interested partners can refer to this article to introduce the plug-in jquery. the implementation method of the confirm pop-up confirmation message has some reference value. We will share it with you for your reference. The specific content is as follows:

Effect:

Code:

1. Default plug-in Parameters

// Default parameter $. confirm. defaults = {// style css: "http://static.qianduanblog.com/css/jquery.confirm/default.min.css? V = "+ Math. ceil (new Date ()/86400000), // the content of the confirmation box content:" OK? ", // Confirmation button text sureButton:" OK ", // cancel button text cancelButton:" cancel ", // position :{}, // autoOpen: false automatically opens, // animation duration: 123, // enable confirmation box callback onopen: emptyFn, // click confirm or cancel the callback onclick: emptyFn, // confirm the callback onsure: emptyFn, // cancel the callback oncancel: emptyFn, // close the confirmation box and callback onclose: emptyFn}

2. Plug-in structure and style
The dom structure of jquery. confirm is as follows:

Confirmation box message

Confirm Cancel

The default plug-in style is based on css.3. The default plug-in style address is default. The plug-in style is only rendered once and will not be rendered multiple times. The first time you use the plug-in style is used as the standard.

3. Usage

// Open the confirmation box $. confirm ({content: "Are you sure you want to view it? ", Onopen: function () {alert (" confirmation box opened! ") ;}, Onclose: function () {alert (" the confirmation box is closed! ") ;}, Onsure: function () {alert (" You clicked the OK button! ") ;}, Oncancel: function () {alert (" You have clicked the cancel button! ") ;}, Onclick: function (s) {if (s) {alert (" You clicked the OK button! ");} Else {alert (" You have clicked the cancel button! ") ;}}); $. Confirm (" OK? ", Function (s) {if (s) {alert (" You clicked the OK button! ");} Else {alert (" You have clicked the cancel button! ");}});

I hope this article will help you learn jquery programming.

Related Article

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.