In order to use the plugin you need to:
$.mambo([options]) on your canvas
$(".full-features").mambo({
percentage: 65,
label: "Cr",
displayValue: true,
labelColor: "#ccc",
circleColor: '#5965E5',
circleBorder: '#282D66',
ringStyle: "full",
ringBackground: "#999EDD",
ringColor: "#393F90",
drawShadow: true
});
This is the full list of options/customizations that could be passed to the plugin.
| Option | Type | Default | Description |
|---|---|---|---|
| percentage | float | 100 | The percentage represented by the badge. |
| image | string | none | If an image path is specified label will not be considered. The image will be scaled to the maximum size that fits the badge. |
| label | string | none | The label show in the badge; due to technical limitations the max length i 3 chars. If neither label and image are not set the badge will show the percentage. |
| labelColor | string | #FFF | Let you choose the text color. The color will be applied also to the value if showed. |
| displayValue | boolean | true | Indicates if the value should be displayed or not above the text. If the label is not specified the scripts automatically shows the value. |
| circleColor | float | #F2AC29 | The color used to fill the internal circle. |
| circleBorder | float | #FFF | The color used for the internal circle border. |
| ringStyle | string | percentage | If "percentage" the external ring will be drawn proportionally to the value of the percentage; e.g.: 100% will draw a full circle around the badge, 50% half a circle and so on. If "full" a complete ring is drawn, regardeless of the percentage value. |
| ringColor | string | #F2762E | The color used for the external ring. |
| ringBackground | string | #CCC | If you chose to draw a complete ring using ringstyle: "full", the remaining part of the circle will be filled with this color. |
| drawShadow | boolean | false | Draw a little shadow on the edge of the badge. |
Take a look at the code for the demos used in the main carousel.
$(".default").mambo({
percentage: 65
});
$(".only-label").mambo({
percentage: 37,
label: "Lbl",
displayValue: false,
circleColor: '#C9D94E',
circleBorder: '#535920',
ringColor: "#8E9937"
});
$(".label-value").mambo({
percentage: 59,
label: "Lbl",
circleColor: '#9136C7',
ringColor: "#632587"
});
$(".percentage-fill").mambo({
percentage: 43,
label: "Pf",
displayValue: true,
circleColor: '#7ACAD9',
ringStyle: "full",
ringColor: "#7ACAD9",
drawShadow: true
});
$(".image-badge").mambo({
image: "/media/images/Gnome_Monkey.png",
circleColor: '#F2DEBB',
circleBorder: '#736959',
ringColor: "#A69880",
drawShadow: true
});
$(".just-badge").mambo({
displayValue: false,
label: "",
circleColor: '#FD92A1',
circleBorder: '#FD5EBA',
ringColor: "#F2385A",
drawShadow: true
});
Since I work on this project spending my (little) spare time I have left from work/girlfriend/beer I don't know when this list of features could be available!
mouseenter and mouseleave events redrawing the percentage bar using an easing functiontext options giving it much customizations.I'm always looking for feedbacks and suggestions, so if you want to see a feature implemented or simply tell me how to improve this plugin please don't hesitate to contact me!