Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 233 lines (134 sloc) 6.06 kb
eae1182 updating docs for Keyboard, Waiter, and Mask
Aaron Newton authored
1 Class: Mask {#Mask}
2 ===================
3
4 Adds a semi-transparent overlay over a DOM element.
5
6 ### Implements
7
8 * [Options][], [Events][]
9
10 ### See Also
11
ace5a3e renaming Waiter to Spinner
Aaron Newton authored
12 * [Spinner][]
eae1182 updating docs for Keyboard, Waiter, and Mask
Aaron Newton authored
13
8f969cc Arian Stolwijk Add Links to the new Demos in the Docs + make sure each class has a "Cla...
arian authored
14
15 Mask Method: constructor
16 ------------------------
17
eae1182 updating docs for Keyboard, Waiter, and Mask
Aaron Newton authored
18 ### Syntax
19
20 new Mask(target[, options]);
21
22 ### Arguments
23
24 1. target - (*mixed*) A string of the id for an Element or an Element reference to overlay; defaults to *document.body*
25 2. options - (*object*) a key/value set of options
26
27 ### Options
28
29 * inject - (*object*) where to inject the layer. If not specified, the mask is injected into the document body. Example: *inject: { where: 'after', target: element }*
30 * hideOnClick - (*boolean*) if *true*, the mask will hide when clicked. Defaults to *false*.
31 * id - (*string*) if defined, the overlay layer will be assigned this id. If not defined, the id will default to 'mask-<timestamp>'
32 * destroyOnHide - (*boolean*) if *true* the mask layer is destroyed when hidden. The class will no longer function after this. Defaults to *false*.
33 * class - (*string*) the css class to apply to the layer; defaults to 'mask'.
a86ec71 adding css file for default styles for Mask
Aaron Newton authored
34 * style - (*object*) if defined, will apply to the mask with [Element.setStyles][]. You can also style the layer by just defining a style for the layer class name (defaults to ".mask"). Default styles can be found in the Styles directory of the MooTools More library on github or downloaded on the More builder on MooTools.net.
eae1182 updating docs for Keyboard, Waiter, and Mask
Aaron Newton authored
35 * maskMargins - (*boolean*) if *true* the mask will extend to the margins of the target. Defaults to *false*.
36 * useIframeShim - (*boolean*) if true the mask will use [IframeShim][] to hide OS elements (select boxes, flash, etc) for IE6.
79cbd27 adding options for the iframeShim for Mask
Aaron Newton authored
37 * iframeShimOptions - (*object*) options passed to [IframeShim][].
eae1182 updating docs for Keyboard, Waiter, and Mask
Aaron Newton authored
38
39 ### Events
40
77ee780 David Walsh LOTS more doc fixes, including removing 'on' from events, which I vehemn...
darkwing authored
41 * show - (*function*) callback to execute when the layer is shown; passed the target element to which the [Mask][] was attached.
42 * hide - (*function*) callback to execute when the layer is hidden; passed the target element to which the [Mask][] was attached.
43 * destroy - (*function*) callback to execute when the layer is destroyed.
44 * click - (*function*) callback to execute when the layer is clicked.
eae1182 updating docs for Keyboard, Waiter, and Mask
Aaron Newton authored
45
46 ### Examples
47
48 var myMask = new Mask();
49 var myMask = new Mask($('myElement'));
50
9fb0258 adding style info to mask/spinner docs
Aaron Newton authored
51 ### Styles
52
f9b63b0 updating doc links to asset files to point to the trunk's current versio...
Aaron Newton authored
53 The mask element is not styled, so if you don't add a css rule in your style sheets, it will be invisible. You can download the default styles here: [mask.css](http://github.com/mootools/mootools-more/raw/master/Styles/Interface/Mask/mask.css)
9fb0258 adding style info to mask/spinner docs
Aaron Newton authored
54
eae1182 updating docs for Keyboard, Waiter, and Mask
Aaron Newton authored
55 Mask Method: toggle {#Mask:toggle}
56 --------------------------------------
57
58 Toggles the [Mask][] visibility. If the [Mask][] is currently visible, it will hide. Otherwise it will display.
59
60 ### Syntax
61
ace5a3e renaming Waiter to Spinner
Aaron Newton authored
62 myMask.toggle(element);
eae1182 updating docs for Keyboard, Waiter, and Mask
Aaron Newton authored
63
64 ### Arguments
65
66 1. element - (*mixed*, optional) A string of the id for an Element or an Element reference to overlay; defaults to the target passed in at initialization, but you can specify a different element if you wish to reuse the class.
67
68 ### Returns
69
70 * (*object*) This instance of [Mask][]
71
72 Mask Method: show {#Mask:show}
73 ------------------------------------
74
75 Displays the [Mask][] layer.
76
77 ### Syntax
78
79 myMask.show();
80
81 ### Returns
82
83 * (*object*) This instance of [Mask][]
84
85 Mask Method: hide {#Mask:hide}
86 ----------------------------------
87
88 Hides the [Mask][] layer.
89
90 ### Syntax
91
92 myMask.hide();
93
94 ### Returns
95
96 * (*object*) This instance of [Mask][]
97
98 Mask Method: destroy {#Mask:destroy}
99 ------------------------------------
100
101 Destroys the [Mask][] layer. This renders the instance of this class inert (and further calls to its methods will throw errors).
102
103 ### Syntax
104
105 myMask.destroy()
106
107 ### Returns
108
109 * (*object*) This instance of [Mask][]
110
111 Mask Method: position {#Mask:position}
112 ------------------------------------
113
114 Reasserts the position of the overlay layer.
115
116 ### Syntax
117
118 myMask.position()
119
120 ### Returns
121
122 * (*object*) This instance of [Mask][]
123
124
125 Mask Method: resize {#Mask:resize}
126 ------------------------------------
127
128 Reasserts the dimensions of the overlay layer. Note that this method is called when [Mask.position][] is called, so you needn't call it if you call position.
129
130 ### Syntax
131
58b090d fixing a typo
Aaron Newton authored
132 myMask.resize()
eae1182 updating docs for Keyboard, Waiter, and Mask
Aaron Newton authored
133
134 ### Returns
135
136 * (*object*) This instance of [Mask][]
137
eb28804 Arian Stolwijk A lot of Docs changes and fixes for 1.3 Documentation
arian authored
138 Type: Element {#Element}
eae1182 updating docs for Keyboard, Waiter, and Mask
Aaron Newton authored
139 ==========================
140
eb28804 Arian Stolwijk A lot of Docs changes and fixes for 1.3 Documentation
arian authored
141 Extends the Element Type with [Mask][] methods.
eae1182 updating docs for Keyboard, Waiter, and Mask
Aaron Newton authored
142
143 Element Property: mask {#Element-Properties:mask}
144 ---------------------------------------------------
145
146 ### Setter
147
148 Sets a default [Mask][] instance for an Element.
149
4532ef9 doc styling
Aaron Newton authored
150 #### Syntax
eae1182 updating docs for Keyboard, Waiter, and Mask
Aaron Newton authored
151
152 el.set('mask'[, options]);
153
154 #### Arguments
155
156 1. options - (*object*, optional) The [Mask][] options.
157
158 #### Returns
159
160 * (*element*) This Element.
161
162 #### Examples
163
164 el.set('mask', {onClick: function(){..etc..}});
165 el.mask(); //obscure the element with the overlay
166 el.unmask(); //hide the overlay
167
168 ### Getter
169
170 Gets the default [Mask][] instance for the Element.
171
172 #### Syntax
173
2546669 Arian Stolwijk Documentation Updates to reflect the changes for the 1.3 release.
arian authored
174 el.get('mask');
eae1182 updating docs for Keyboard, Waiter, and Mask
Aaron Newton authored
175
176 #### Arguments
177
178 1. name - (*string*) This should always be 'mask'.
179
180 #### Returns
181
182 * (*object*) The Element's internal [Mask][] instance.
183
184 #### Examples
185
186 el.set('mask', {onClick: function(){..etc..}});
ace5a3e renaming Waiter to Spinner
Aaron Newton authored
187 el.mask(); //show the mask
eae1182 updating docs for Keyboard, Waiter, and Mask
Aaron Newton authored
188 el.get('mask'); //The Mask instance.
189
7c75d35 Arian Stolwijk Docs: Native -> Types
arian authored
190 Type: Element {#Element}
eae1182 updating docs for Keyboard, Waiter, and Mask
Aaron Newton authored
191 ==========================
192
193 Adds [Mask][] shortcuts to the [Element][] class.
194
195 Element Method: mask {#Element:mask}
196 ----------------------------------------
197
198 Retrieves the "build-in" instance of [Mask][] and calls its *show* method.
199
200 ### Syntax
201
202 $('myElement').mask([options]);
203
204 ### Arguments
205
206 1. options - (*object* - optional) the options for the default mask.
207
208 ### Returns
209
210 * (*element*) This Element
211
212 Element Method: unmask {#Element:unmask}
213 --------------------------------------------
214
215 Retrieves the "build-in" instance of [Mask][] and calls its *hide* method.
216
217 ### Syntax
218
219 $('myElement').unmask();
220
221 ### Returns
222
223 * (*element*) This Element
224
9fb0258 adding style info to mask/spinner docs
Aaron Newton authored
225 [Mask]: #Mask
eae1182 updating docs for Keyboard, Waiter, and Mask
Aaron Newton authored
226 [Mask.position]: #Mask:position
ace5a3e renaming Waiter to Spinner
Aaron Newton authored
227 [Spinner]: /more/Interface/Spinner
eae1182 updating docs for Keyboard, Waiter, and Mask
Aaron Newton authored
228 [Options]: /core/Class/Class.Extras#Options
229 [Events]: /core/Class/Class.Extras#Events
2546669 Arian Stolwijk Documentation Updates to reflect the changes for the 1.3 release.
arian authored
230 [Element]: /core/Element/Element
eae1182 updating docs for Keyboard, Waiter, and Mask
Aaron Newton authored
231 [Element.setStyles]: /core/Element/Element.Style
232 [IframeShim]: /more/Browser/IframeShim
Something went wrong with that request. Please try again.