'Interact js set position and size programatically

I use interact js 1.10.11

and I want to change the position (top, left) and size (width, height) of my elements with inputs.

Currently I change the css value

element.css('top', '50px') ;
element.css('width', '500px') ;

It works but when I drag my element, it teleports to another place on the page and I can't explain it.

How can I do this properly ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source