jQuery Draggable plugin integration with Views 3
I know this isn't exactly what you asked for, but have you considered using the draggable views module? It does what you aim to do without you having to code anything.