Utility methods to change modifier attributes of Onsen UI elements..
ons.modifier.add(myOnsInputElement, 'underbar');
ons.modifier.toggle(myOnsToastElement, 'custom-modifier');
Signature | Description |
---|---|
add(element, modifier [, modifier]) | Add the specified modifiers to the element if they are not already included. |
remove(element, modifier [, modifier]) | Remove the specified modifiers from the element if they are included. |
contains(element, modifier) | Check whether the specified modifier is included in the element. |
toggle(element, modifier [, force]) | Toggle the specified modifier. |
Add the specified modifiers to the element if they are not already included.
Name | Type | Description |
---|---|---|
element | HTMLElement | Target element. |
modifier | String | Name of the modifier. |
Remove the specified modifiers from the element if they are included.
Name | Type | Description |
---|---|---|
element | HTMLElement | Target element. |
modifier | String | Name of the modifier. |
Check whether the specified modifier is included in the element.
Returns: true
when the specified modifier is found in the element’s modifier
attribute. false
otherwise.
Name | Type | Description |
---|---|---|
element | HTMLElement | Target element. |
modifier | String | Name of the modifier. |
Toggle the specified modifier.
If you have any questions, use our Community Forum or talk to us on Discord chat. The Onsen UI team and your peers in the community will work together to help solve your issues.
For bug reports and feature requests use our GitHub Issues page.