Alert, confirm solution based on jquery ui (skin replacement supported), jqueryconfirm

Source: Internet
Author: User

Alert, confirm solution based on jquery ui (skin replacement supported), jqueryconfirm

Functions:

1. Modify the title style. Put the title style of jquery ui. Supports skin replacement.

2. Change the button style to the jqueryui button style.

3. Replace the background of the model window with the modeled background of jqueryui.

Code:

// First introduce jquery, as well as the ui package and skin style, such as: <script src = ".. /js/ui/jquery-1.11.0.min.js "> </script> <script src = ".. /js/ui/jquery-migrate-1.1.0.min.js "> </script> <script src = ".. /js/ui/minified/jquery. ui. core. min. js "> </script> <script src = ".. /js/ui/minified/jquery. ui. widget. min. js "> </script> <script src = ".. /js/ui/minified/jquery. ui. mouse. min. js "> </script> <script src = ".. /js/ui/minified/jquery. ui. button. min. js "> </scrip T> <script src = ".. /js/ui/minified/jquery. ui. draggable. min. js "> </script> <link rel =" stylesheet "type =" text/css "href = ".. /js/ui/themes/humanity/jquery-ui.css "> </link> (function ($) {$. alerts = {// These properties can be read/written by accessing $. alerts. propertyName from your scripts at any time verticalOffset:-75, // vertical offset of the dialog from center screen, in pixelshorizontalOffset: 0, // Horizontal offset of the dialog from center screen, in pixels/repositionOnResize: true, // re-centers the dialog on window resizeoverlayOpacity :. 01, // transparency level of overlayoverlayColor: '# fff', // base color of overlaydraggable: true, // make the dialogs draggable (requires UI Draggables plugin) okButton: 'confirmed', // text for the OK buttoncancelButton: 'cancel', // text for the Cancel bu TtondialogClass: null, // if specified, this class will be applied to all dialogs // Public methods alert: function (message, title, callback) {if (title = null) title = 'alert '; $. alerts. _ show (title, message, null, 'alert ', function (result) {if (callback) callback (result) ;}, confirm: function (message, title, callback) {if (title = null) title = 'Confirm'; $. alerts. _ show (title, message, null, 'Confirm', function (result) {if (callback) callback (result) ;}) ;}, prompt: function (message, value, title, callback) {if (title = null) title = 'propt'; $. alerts. _ show (title, message, value, 'propt', function (result) {if (callback) callback (result) ;}, // Private methods _ show: function (title, msg, value, type, callback) {$. alerts. _ hide (); $. alerts. _ overlay ('show'); $ ("BODY "). append ('<div I D = "popup_container" style = "width: 300px; height: 150px;"> '+' 

The above is all the content of this article. I hope you will like it.

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.