To achieve the desired effect, utilize translate3d() with the last parameter set to zero.
Adjust the positioning of tile elements to align in the top corner (0, 0) or based on the specified offset using CSS.
Create a function that moves each tile element to its designated position (assuming pixels, but this can be customized):
function moveElement(element, xPosition, yPosition) {
var movement = ("translate3d( " + xPosition + "px, " + yPosition + "px, 0 )");
element.style.webkitTransform = movement;
element.style.MozTransform = movement;
element.style.msTransform = movement;
element.style.OTransform = movement;
element.style.transform = movement;
}
Invoke the function for each tile using default or saved configurations to place them accordingly.
Once completed, simply provide the element (referred to as "el") along with the new desired position to moveElement:
// Assuming each grid section is 50px wide, with row1col1 starting at (0, 0)
moveElement(el, 50, 50);
You have the flexibility to adjust the inputs to object properties or array elements based on how the information is stored.