vanta
vanta copied to clipboard
Why can't I use effect.setOptions from a function on click in javascript
const changeEffect=()=>{ effect.setOptions({ color: 0xff88cc }); }
why can't I do this ? I am new to web dev. I am planning to change the color of the birds on a button click. I wrote this code ->
`const effect = VANTA.BIRDS({ el: "#main", mouseControls: true, touchControls: true, gyroControls: false, minHeight: 200.00, minWidth: 200.00, scale: 1.00, scaleMobile: 1.00, color1: 0xacff, color2: 0x60ff00 });
const changeEffect=()=>{ effect.setOptions({ color: 0xff88cc }); }`
But It is not happening.
I am calling the changeEffect
on a button click.
@cadris did you ever figure this out?