Answer the question
In order to leave comments, you need to log in
Sorting elements with jquery?
Good afternoon! I saw on one site a very interesting sorting.
drumshop.ru/snares/metal/#brand=all;sort=top (click “cheap”, “expensive”, click on brands)
I would like to know if there is a ready-made solution in js or will you have to write it yourself from scratch? I'm just a complete noob when it comes to js. I really liked this sorter. Beautiful and comfortable.
Thank you very much in advance.
Answer the question
In order to leave comments, you need to log in
It seems to me that the UI does not work there, the standard Jquery animation.
1. Translate the elements to position:absolute + current coordinates
2. Sort the elements inside the parent in the right order
3. Calculate the new coordinates of each, taking into account the new order
4. Start the movement + animation for all at the same time
5. After completing all the animations, remove position:absolute
6 .!!!
7. PROFIT!
ruseller.com/lessons.php?rub=32&id=827
ruseller.com/lessons.php?rub=32&id=512
if you search through jquery lessons, you can find a few more examples
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question