2
I inserted some animated pizza graphics on my page, but I would like the animation to be started only when the DIV that holds these graphics was displayed on the screen, someone would know how to do this?
The following animation should be started when the DIV with the graphics is visible:
$('#pie-one,#pie-two,#pie-tree').pieChart({
barColor: '#21d927',
trackColor: '#eee',
lineCap: 'square',
lineWidth: 18,
onStep: function (from, to, percent) {
$(this.element).find('.pie-value').text(Math.round(percent) + '%');
}
});
Thank you.
I could ask the question a [mcve] demonstrating this behavior?
– Woss
Insert the script that performs the animation, the plugin has the name of pie-Chart, this helps?
– Munir Baarini
Which is the div with the charts?
– Sam
When and how it becomes visible on the screen?
– Sam
It is visible when you scroll the page to it.
– Munir Baarini
But you want the animation to happen as soon as the div appears a little, in the middle, a little, all?
– Sam
Ideally when she’s at least half visible.
– Munir Baarini