Q.Masks Class
Methods for temporarily covering up certain parts of the screen with masks
Item Index
Methods
- globalNamesAdded static
- hide static
- isVisible static
- mask static
- noConflict
- show static
- stackTrack static
- update static
Methods
globalNamesAdded
()
static
This function is useful to make sure your code is not polluting the global namespace
hide
-
key
Hides the mask by given key. If mask with given key doesn't exist, fails silently.
Parameters:
-
key
StringA key of the mask to hide
isVisible
-
key
Checks if a mask with given key has been created and is currently being shown.
Parameters:
-
key
StringThe key of the mask
mask
-
key
-
[options={}]
Creates new mask with given key and options, or returns already created one for that key.
Parameters:
-
key
StringA string key to identify mask in subsequent Q.Masks calls.
-
[options={}]
Object optionalThe defaults are taken from Q.Masks.options[key]
-
[className='']
String optionalCSS class name for the mask to style it properly.
-
[fadeIn=0]
Number optionalMilliseconds it should take to fade in the mask
-
[fadeOut=0]
Number optionalMilliseconds it should take to fade out the mask.
-
[duration]
Number optionalIf set, hide the mask after this many milliseconds.
-
[zIndex]
Number optionalYou can override the mask's default z-index here
-
[html='']
String optionalAny HTML to insert into the mask.
-
[shouldCover=null]
HTMLElement optionalOptional element in the DOM to cover.
-
Returns:
the mask info
noConflict
-
extend
This method restores the old window.Q and returns an instance of itself.
Parameters:
-
extend
BooleanIf true, extends the old Q with methods and properties from the Q Platform. Otherwise, the old Q is untouched.
Returns:
Returns the Q instance on which this method was called
show
-
key
-
[options={}]
Shows the mask by given key. Only one mask is shown for any given key. A counter is incremented on Masks.show and decremented on Masks.hide, causing the mask to be hidden when the counter reaches zero. If a mask with the given key doesn't exist, Mask.create is automatically called with the key and options from Q.Masks.options[key] .
Parameters:
Returns:
the mask info
stackTrack
()
static
This function is useful for debugging, e.g. calling it in breakpoint conditions
update
()
static
Updates size and appearance of all the masks. Automatically called on Q.onLayout