CORE
NATIVE
TABLE
MAKE
CUSTOMIZE
EFFECTS
VIRTUAL BOX
PLUG-IN
|
custom_base.js
Contains Class Custom
Requires Summary Custom | | A powerful wrapper which allows you to create modal boxes |
Implements Overlay
Constructor new Custom (title, text, options)
Properties title | | a string represents the title of the box | text | | a string represents the content text of the box | options | | optional. an object which permits to customize the box |
Options enable | | an object which allows to decide which zones and events must be created | zones | | an object which contains the class names of the box zones | buttons | | an object which contains the buttons css classes | text | | an object which contains the buttons contents | height | | the box height. Default is 'auto' | width | | the box width. Default is '300px' | opacify | | if true the box appears and disappears with an opacity transition. Default is true | content | | 'text' or 'html', the content types of the box title, the box box and the box buttons. Default is 'text' | draggable | | if true the box will be draggable. Default is true | dragOpacity | | if true the box will be affected by a fade effect on drag | adjustStyles | | if true adjusts the position of the box on window resize. Default is true | promptType | | an object which contains the prompt settings | overlay | | the type of the overlay. 'lighten', 'darken', color or false (default) |
enable:
-
closeButton : if true the close button will be added
-
confirmButton : if true the confirm button will be added
-
cancelButton : if true the cancel button will be added
-
textBox : if true the prompt will be displayed (can be an input or a textarea)
-
onConfirm : if true the onConfirm event will be fired
-
onCancel : if true the onCancel event will be fired
zones:
-
box : is the box that contains the other zones
-
head : is the header of the box. (contains the title)
-
body : is the main content of the box
-
buttonBox : the zone which contains the confirm and cancel buttons
-
promptBox : the zone which contains the prompt (input or textarea)
buttons:
-
confirmButton : the confirm button class name
-
closeButton : the close button class name
-
cancelButton : the cancel button class name
text:
-
confirmButtonText : the text of the confirm button. Defaults to 'OK'
-
closeButtonText : the text of the close button. Defaults to 'X'
-
cancelButtonText : the text of the cancel button. Defaults to 'Cancel'
promptType:
-
box : 'single' or 'multi'. Default is 'single'
-
lines : if box is 'multi' represents the number of lines. Default is 4
-
startValue : the start value. Default is ''
-
search : where to search your value. Can be 'google', 'yahoo', 'wikipedia' or false (default)
-
target : indicates if open another window for the custom search. Can be 'new' (default) or 'same'
Events onConfirm | | function fired when users confirm | onCancel | | function fired when users cancel |
Methods create | | creates the custom box | setText | | sets the text of the custom box | setTitle | | sets the title of the custom box | setIDs | | sets the id value respectively for the box, the overlay and the fullpage at once |
Implements [Options, Events, Overlay],
top method create
creates the custom box
Example var cc = new Custom.Confirm('custom confirm', 'Do you want to submit?',
{box:'ccbox', head: 'cchead', body: 'ccbody'});
cc.create();
top method setText
sets the text of the custom box
Arguments text | | the new content value. The content you can set depends on the 'content' options |
Example // change the previous text
box.setText('Custom Alert/Confirm with some new text');
top method setTitle
sets the title of the custom box
Arguments title | | the new title value. The content you can set depends on the 'content' options |
Example // change the previous title
box.setTitle('A new Custom Alert/Confirm title');
top method setIDs
sets the id value respectively for the box, the overlay and the fullpage at once
Arguments box | | the new box id | overlay | | the new overlay id | fullpage | | the new fullpage id |
Example box.setIDs('myNewBoxID', 'myNewOverlayID', 'myNewFullPageID');
Documentation By
Riccardo Degni -
powered by MakeDocs, CMS by RD
The moo.rd documentation is released under the
Creative Commons BY-NC SA License
|