Save packery gird items default positions

177 views Asked by At

I need to save the default positions of the grid items on a button click. I'm able to save and reload the grid items. but, after resetting the grid items, if I hit F5 it is taking me back to previous grid positions.

I want to save default positions on a click. please help.

thanks in advance.

// I'm not able to save the default grid positions after this line of code. $grid.packery('reloadItems');

1

There are 1 answers

0
Parapluie On

What you are looking for is the "stamp" option for Packery. From Packery's docs:

Packery will layout items around stamped elements. The stamp option stamps elements only when the Packery instance is first initialized. You can stamp additional elements afterwards with the stamp method.

Have a look at this guide for more details and instructions.