Animate element to position in grid

Giganews Newsgroups
Subject: Animate element to position in grid
Posted by:  Andrew Poulos (ap_pr…@hotmail.com)
Date: Sun, 15 Nov 2020

I have a "small" div that appears at a random spot in the page. The page
is split by a responsive CSS grid into an number grid areas. I need to
move the div into the centre of one of the areas to a position that
would match "place-self: center".

Is there a way I get the offsetLeft and Top positions of the "finished"
location?

One idea was to clone the div, set its visibility to hidden, place it
with CSS, get its position, and then to remove it.

Andrew Poulos

Replies