Object position in javascript
Hello to all colleagues, I have a problem in using a JavaScript code that I hope those who are familiar with this language will answer.
The following code is used to animate an object:
var theObject5 = document.querySelectorAll("[data-acc-text='shake']");
function Tween(){
var T = gsap.to(theObject5 ,0.15,{x:R(-10,10),y:R(-10,10),scale:R(1.1,0.9),rotation:R(-10,10),ease:Sine.easeInOut,onComplete:Tween})
};
Tween();
function R(max,min){return Math.random()*(max-min)+min};
or ===>
gsap.to(theObject5, 0.1, {x:"+=20", yoyo:true, repeat:5});
The code works correctly and animates the shape, but the problem is that it moves the object to the upper left corner, while I want the object to stay in place and shake.
I am sending the project in the attachment.