Web Hosting Talk







View Full Version : Making elements of a page drag dropable


jphayes
06-15-2007, 07:40 AM
Hi All,

Heres my problem:

Enter domain, code loads the site in a frame of sorts - no problem there.
However there is a requirement to make the elements of the site, tables etc... so that they can be re-arranged.

I a bit lost on where to start with this. Has anybody experience of doing such a thing?

BTW: My preferred language is php to do this in.

Thanks in advance.
jp

sasha
06-15-2007, 08:05 AM
For drag and drop you need some front-end technology (JavaScript). I like
http://script.aculo.us/ libraries myself. If you need to save the state you can use cookies, so you can restore elements positions. If you want to save state on server and provide different content based on it you might need to hook in some RPC calls on your events (AJAX) and call your server scripts (PHP).

jphayes
06-19-2007, 06:21 AM
I've managed to get a basic parser going which assigns elemental ids to each tag and using these id's the elements are then made droppable.

Check out boxaweb.com for a example of such a process

fastnoc
06-19-2007, 06:24 AM
jQuery is by far the best library I've ever used. All the functions you mention are available as drop ins too.


www.jquery.com

demo
http://interface.eyecon.ro/demos/sort.html

demo
http://interface.eyecon.ro/demos/download.html

jphayes
06-22-2007, 10:55 AM
Thanks for that Fastnoc.