You can use the plugin methods after you have initialized the plugin.
Plugin method | Description |
---|---|
getContent() | Returns the current content that is set for the badge. Not chainable. |
setContent(content) |
Set the content of your badge. Your content can be a Number or a String e.g. .setContent(2) . Increase or decrease your current badge number by passing a + or - prefixed number in a string e.g. .setContent('+7') . Chainable.
|
setPosition(position) |
Set the position of your badge. Options are: 'top-left' , 'top-right' , 'bottom-left' or 'bottom-right' . Chainable.
|
setTheme(theme) |
Set the theme of your badge. Default themes are: 'red' , 'blue' , 'green' , 'grey' and 'ios' . Themes can be configured in the iosbadge.scss file and then built with the included build tool. Chainable.
|
setSize(size) |
Set the size of your badge. Sizes can be configured in the 'iosbadge.scss' file and then built with the included build tool. Available default sizes are: 20 , 22 , 24 , 26 , 28 , 30 , 32 , 34 and 36 . Chainable.
|
decreaseBy(amount) | Decrease the current number in your badge. Chainable. |
increaseBy(amount) | Increase the current number in your badge. Chainable. |
hide() | Hide your badge element. Chainable. |
show() | Show your badge element. Chainable. |