Plugin options

With the Javascript version the plugin options can be configured when invoking the plugin, e.g. new IOSBadge(element, { size: 20 });. With the jQuery/Zepto version you can use the plugin options instead of the chainable methods of the Javascript version.

Plugin option Description Default value
content Set the content of your badge. Content can be a number or a string. Increase or decrease your current badge number by passing a + or - prefixed number in a string e.g. .setContent('+7') 1
size Set the size of your badge. Available default sizes are: 20, 22, 24, 26, 28, 30, 32, 34 and 36. Sizes can be configured in the iosbadge.scss file and then built with the build tool. 20
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. 'red'
position Set the position of your badge. Options are: 'top-left', 'top-right', 'bottom-left' or 'bottom-right'. 'top-right'
namespace Change the namespace used by the plugin. This needs to be changed in iosbadge.scss file as well. 'iosb'