metafizzy / packery

:bento: Gapless, draggable grid layouts
https://packery.metafizzy.co
4.14k stars 315 forks source link

Disabling 'swap' on specific item #506

Closed JozefJavorsky closed 6 years ago

JozefJavorsky commented 6 years ago

Hello, I'm building a web app (vocalbulary) where I have 4 colums. Each column contains a set of

  • tags. I am using packery for reordering the list. The goal of the app is to find the pairs among columns. It is basically 4 colums with words, a column for each language and you have to reorder the words so that they match the translation ( car - coche - auto). After the pair is found I want the
  • tag to be "frozen" and disable the "swap" with other elements, if that makes sense. If i use .draggable('disable'), it prevents the element from moving, but the element can still be swapped with other elements. I would Like to ask if there is any method for achieving this (dragable elements ignoring the frozen element) thanks

  • desandro commented 6 years ago

    if there is any method for achieving this (dragable elements ignoring the frozen element)

    You can use the stamp and unstamp methods