Skip to content

Instantly share code, notes, and snippets.

@Pavracer
Last active November 28, 2023 05:12
Show Gist options
  • Save Pavracer/a562e408c2784dce0c0e783e897ad5c1 to your computer and use it in GitHub Desktop.
Save Pavracer/a562e408c2784dce0c0e783e897ad5c1 to your computer and use it in GitHub Desktop.
<script type="text/javascript">
(function($) {
$(document).ready(function() {
window.et_pb_circle_counter_init = function($the_counter, animate) {
if ( 0 === $the_counter.width() ) {
return;
}
$the_counter.easyPieChart({
animate: {
duration: 1800,
enabled: true
},
size: 0 !== $the_counter.width() ? $the_counter.width() : 10,
barColor: $the_counter.data( 'bar-bg-color' ),
trackColor: $the_counter.data( 'color' ) || '#790707',
trackAlpha: $the_counter.data( 'alpha' ) || '1',
scaleColor: false,
lineWidth: 15,
onStart: function() {
$(this.el).find('.percent p').css({ 'visibility' : 'visible' });
},
onStep: function(from, to, percent) {
$(this.el).find('.percent-value').text( Math.round( parseInt( percent ) ) );
},
onStop: function(from, to) {
$(this.el).find('.percent-value').text( $(this.el).data('number-value') );
}
});
}
$et_pb_circle_counter = $( '.custom-circle.et_pb_circle_counter .et_pb_circle_counter_inner' );
if ( $et_pb_circle_counter.length) {
$( '.custom-circle.et_pb_circle_counter' ).each(function(){
window.et_pb_circle_counter_init($(this).find('.et_pb_circle_counter_inner'));
});
}
});
})(jQuery)
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment