Little help with my code please! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Little help with my code please!

I have created one object called 'smiley' and a shadow for it. I have tryed to animate those objects with JS jQuery but it not work properlly. My intention was to make 'smiley' bounce from the surface (shadow) and the shadow to stay on the same place and only to transform in width. But when I run the code both objects are moving down (the shadow should be fixed) and up(like bounce) and the shadow doesn't get wider. Please help me to solve this issue and tell me where is my mistake, because the animation of the objects with jQuery is realy cool thing but gets very annoying when you don't know how to do that. Thank You

28th Jul 2017, 10:57 AM
Dragan Lazarevski
6 Answers
+ 5
Use the svg animate and animateMotion tags, not JS, JQuery or CSS https://code.sololearn.com/WmYCeg0K4G2c/?ref=app
28th Jul 2017, 1:21 PM
The Coding Sloth
The Coding Sloth - avatar
+ 5
in the CSS don't use position absolute 😐
28th Jul 2017, 12:26 PM
Art456
Art456 - avatar
+ 4
you make the shadow and the simely in one svg
28th Jul 2017, 12:55 PM
Art456
Art456 - avatar
28th Jul 2017, 3:07 PM
Calviղ
Calviղ - avatar
+ 1
I have changed the position but it still not work properlly( the shadow is moving).
28th Jul 2017, 12:35 PM
Dragan Lazarevski
+ 1
Perfect solution Calvin. Your animation is perfect. Well done
28th Jul 2017, 3:38 PM
Dragan Lazarevski