PDA

View Full Version : jQuery Update item attributes when sorting


Psychox
01-05-2010, 02:03 PM
Hi. I'm new to jQuery and I need help with my little project. I'm making drag&drop list to move movie clips and count their times when dropped to destination target... and this is working OK... But main problem is that I want to sort positions in destination div. I don't know how to make all elements time update with sortable->change event. I believe that I have to clear all attributes with $("b").remove(); (I only want to update time) and then use $.each(); function to re-count all elements ant then append "time" to them. Can anyone help me with that?

Here is my code: http://lukasz.webh.pl/test.html

To clarify what I want to achieve: For example lets say It'll be internet radio station program scheduler. On the left hand we have available programs. We are choosing program witch we want to add to schedule and we're dragging it to destination DIV. Then script is collecting its time and show when it should start. So every element (time) should be sum of previous elements. And theoretically it work until we want to change program position...