I’m using scriptaculous to create draggable divs for each of the posts. The first problem was that scriptaculous’s draggable code requires unique id’s for each div that you want to make draggable. I decided to use the subject id as the div name and the message id as the span id. I finally figured out that you can’t have a span id name start with a number, so I concontanated with “span” to create the variable for the javascript span id. Stupidly, I was setting the javascript variables outside of the php for loop so the variables were just resolving to the final value of the loop, which gave me one draggable div. I tried just to echo the javascript in the php for loop, but I couldn’t get it to work, so I put the php for loop around the javascript instead. It seems a bit clunky, but it works!
Next step is to store where the user drags the div’s on each visit …