I have JSON which defines set of pictures.
pictures[{picutreName:"pic1", prio:1},
{picutreName:"pic2", prio:2},
{picutreName:"pic3", prio:3},
{picutreName:"pic4", prio:4},
{picutreName:"pic5", prio:5},
{picutreName:"pic6", prio:6}
]
according to "prio" are pictured ordered (prio:1 is displayed first, prio:6 is last). By "draggable" I would like to change prio of each img element. For instance pic6 should show up before pic1. Can someone advise the logic for "ondragend" which handles the prio correctly? I was trying to setup based on X/Y positions, but for that I would have drag each img first to get the X/Y