jQuery Plugin wAlert

Willie.Smith.Chen

Requirements

  1. jQuery 1.6.4 +

Description

jQuery.Plugin.wAlert is best way to display a sample message, support not iOS / Android drive.

Browsers

  1. Chrome: 37+
  2. Safari: 7+
  3. FireFox: 32+
  4. Opera: 24+
  5. IE: 9+

Demo & API Document

API:

Input : [Method] : (Typeof)

*:Requirement

Method(message*, title, value, function);

  1. wMsg(message*, title, function);
  2. wAlert(message*, title, function);
  3. wConfirm(message*, title, function);
  4. wPrompt(message*, title, value, function);

Message : arguments[0] : (String)

Example:

wMsg('Demo wMsg');

Title : arguments[1] : (String)

Example:

wAlert('Demo wAlert', 'Custom Title');

Value : arguments[2] : (String)

Example:

wPrompt('Demo wPrompt', 'Title', 'Default Value');

Callback : arguments[First Function] : (Function)

Description:

Only First function of arguments will be CallBack Function.

Example:

wConfirm('Demo wConfirm Callback', 'Title', callbackresult );

Return: (Boolean/String)

Only wPrompt() will return String (from Input Value).

Callback Result:

Public Method:

Setting : $.wAlert.options.setisPlaceholder(); : (Boolean)


False(Default): wPrompt Display Value.

Description:You can change the default value of prompt input.

Example:

$.wAlert.options.setisPlaceholder(false);

wPrompt('Message', callback, 'Title', 'Default Value');

Callback Result:


True: wPrompt Placeholder Value.

Description:You can also change the default value of prompt input Placeholder.

Example:

$.wAlert.options.setisPlaceholder(true);

wPrompt('Message', callback, 'Title', 'Placeholder');

Callback Result:

Default Options

$.wAlert.autoExe:true;

Description: Performed automatically loaded when the plug has been completed.

$.wAlert.okButton:" OK ";

Description: Default ok button text.

$.wAlert.cancelButton:" Cancel ";

Description: Default cancel button text.

$.wAlert.defaultOptions(JSON);

Example:

$.wAlert.defaultOptions({

    verticalOffset: 0,

    horizontalOffset: 0,

    flex: false,

    zIndex: 10000,

    repositionOnResize: true,

    overlayOpacity: 0.25,

    isPlaceholder: false,

    customClass: "ios" | "android"

});

$.wAlert.defaultOptions : (Object)
Options Name Default Value Type Comment
zIndex 10000 (Number) The wAlert Dialog's default z-Index.
overlayOpacity 0.25 (Number)
(0.00~1.00)
The wAlert Dialog's default Opacity.
flex false (Boolean) If your want to use css3 flex, you can open this option.
verticalOffset 0 (Number) The wAlert Dialog's Vertical Offset.
horizontalOffset 0 (Number) The wAlert Dialog's Horizontal Offset.
autoResize True (Boolean) Reposition On Resize
isPlaceholder False (Boolean) [API_wPrompt_setisPlaceholder]
customClass Null (String) You can custom you Css Style.
(Reference wAlert.ios.scss/wAlert.ios.css)

License

The MIT License (MIT)


Copyright (c) 2014 williesmithchen


Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:


The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Donations