Hello!
I am not sure what I'm doing wrong, exactly. I'm fairly new to JavaScript, but I've picked it up quite quickly. I am attempting to do something similar: play an animation by clicking a button on my webpage. I have a div containing some graphics and the Desmos Graphing Calculator. I've programmed everything to be set up so that right now if a student clicked on play, it would show shading the region under a graph. Great! That works! But I want to be able to time the playing with a narration and not have to require the student to push play. I would like to be able to toggle the playing of the animation as needed AND also give the student a button to click if they so choose.
I've copied the result of 'getState()' for the calculator from the console:
{
"type": "expression",
"id": "slider1",
"color": "#6042a6",
"latex": "a=3",
"slider": {
"hardMin": true,
"hardMax": true,
"isPlaying": true,
"min": "-2",
"max": "3",
"step": "1"
}
}
Now, I'm assuming I would remove the quotation marks from _type_, _id_, etc. I also assume that "isPlaying: true" should toggle the state of the slider: playing or not. But this does not work when copied into my script. The graph is still static until play is pressed, which is not desired.
Can you please help?