Failed to use a slider to control the rotate of svg pattern

66 views Asked by At

I want to use a slider to control the rotation of SVG pattern by using .setAttribute('patternTransform','rotate(slider.value)') but it indicate an error:"patterntranfom:expected numbers".

enter image description here

I will be very appreciated if someone has an idea about this problem,

you can check my code here

https://plnkr.co/edit/uiUoJBQuCOAtKtWy

var slider2 = parseInt(document.getElementById("slider2").value);
document.getElementById("pattern").setAttribute("patternTransform", "rotate(slider2)")

it is based on Rouby‘s previous answer

0

There are 0 answers