Set/Get element position and size

Hi,

Please add these features to Wix Code! I’m really needing them.

Here’s and example:

// All values are in pixels (px)

$w("#element").left = 100; // Sets the element's x position to 100
$w("#element").top = 50; // Sets the element's y position to 50
$w("#element").width= 20; // Sets the element's width to 20
$w("#element").height= 30; // Sets the element's height to 30

return $w("#element").left // Returns the element's x position
return $w("#element").top // Returns the element's y position
return $w("#element").width // Returns the element's width
return $w("#element").height // Returns the element's height
12 Likes

Can we please have an answer whether this is in plan or not?
Even for a basic thing like positioning a loader next to an activity that is just happening on a single page application requires to create 10s of html/loader elements to show/hide if we can’t move it to the correct place, not to mention other use-cases. Thanks much for consideration! And please answer this whatever the news are.

Hi, has there been any updates on this please?

ditto

I would also love this feature

Yes! Scratching my head for a work around on a specific feature but cannot think of one. Even if it was just within the widget designer…

You can actually now change the position of elements using the Wix Animations API.

@pptgames Thank you sir, I’ll have to check it out but a cursory glance at the reference looks promising!

This is needed