Is it possible to trigger WebKit animation through JavaScript or jQuery | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 3

Is it possible to trigger WebKit animation through JavaScript or jQuery

For ex: rotating an object using (rotateY to 360 deg) at infinite times when clicking the button ......how to activate this through JavaScript or jQuery

3rd Aug 2020, 1:04 PM
M.MANIVANNAN
M.MANIVANNAN - avatar
6 Respostas
+ 3
M.MANIVANNAN remove the animation on another button click, Or using the same button u can toggle class rotate
3rd Aug 2020, 2:16 PM
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ 
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ  - avatar
+ 3
That's awesome you coded what I need then how to stop it after clicking the button
3rd Aug 2020, 2:15 PM
M.MANIVANNAN
M.MANIVANNAN - avatar
+ 2
yes u can rotate img by js r
3rd Aug 2020, 1:24 PM
JOHN WEST
JOHN WEST - avatar
3rd Aug 2020, 1:25 PM
M.MANIVANNAN
M.MANIVANNAN - avatar
+ 2
i dont know the code but i am sure tha it is ossible
3rd Aug 2020, 1:27 PM
JOHN WEST
JOHN WEST - avatar
+ 2
you can either create a class something like 'rotate', the keyframes for animation and then add the animation to that class. then in js on click of button you can add that 'rotate' class OR just create the keyframes, and on click of button add animation to the element, using element.style.animation property https://code.sololearn.com/WSnBUmj4FbIF/?ref=app
3rd Aug 2020, 2:08 PM
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ 
ŠœŠ³. ŠšŠ½Š°ŠæšŸŒ  - avatar