/* jQuery-Circle-Plugin v0.1 by Jamal hassouni https://github.com/jamalhassouni */ (function ($) { // circle animation pluqins by jamal hassouni $.fn.circlos = function () { // deafualt options var DEFAULTS = { backgroundColor: '#b3cef6', // default background color progressColor: '#4b86db', // default progress color percent: 75, // default percent value duration: 2000 // default duration value }; $(this).each(function () { var $target = $(this); // options of circle var options = { // if isset value of background if not use the default value of background color backgroundColor: $target.data('color') ? $target.data('color').split(',')[0] : DEFAULTS.backgroundColor, // if isset value of progress if not use the default value of progress color progressColor: $target.data('color') ? $target.data('color').split(',')[1] : DEFAULTS.progressColor, // if isset value of percent if not use the default value of percent percent: $target.data('percent') ? $target.data('percent') : DEFAULTS.percent, // if isset value of duration if not use the default value of duration duration: $target.data('duration') ? $target.data('duration') : DEFAULTS.duration }; console.log(options); // add divs for structure $target.append('