Utility methods to change modifier attributes of Onsen UI components..
$ons.modifier.add(myOnsInputElement, 'underbar');
$ons.modifier.toggle(myOnsToastElement, 'custom-modifier');
Signature | Description |
---|---|
add(element, modifier [, modifier]) | Add the specified modifiers to the component if they are not already included. |
remove(element, modifier [, modifier]) | Remove the specified modifiers from the component if they are included. |
contains(element, modifier) | Check whether the specified modifier is included in the component. |
toggle(element, modifier [, force]) | Toggle the specified modifier. |
Add the specified modifiers to the component if they are not already included.
Name | Type | Description |
---|---|---|
element | HTMLElement | Target component. |
modifier | String | Name of the modifier. |
Remove the specified modifiers from the component if they are included.
Name | Type | Description |
---|---|---|
element | HTMLElement | Target component. |
modifier | String | Name of the modifier. |
Check whether the specified modifier is included in the component.
Returns: true
when the specified modifier is found in the component’s modifier
attribute. false
otherwise.
Name | Type | Description |
---|---|---|
element | HTMLElement | Target component. |
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.