开发者

drag and drop ordering of images

开发者 https://www.devze.com 2023-01-20 06:26 出处:网络
I have 5 images that go into a banner on my homepage. These images are stored in the database but what I would like the user to do is drag and drop them so they retain some order.

I have 5 images that go into a banner on my homepage. These images are stored in the database but what I would like the user to do is drag and drop them so they retain some order.

What I need to do is a

(i) drag and drop the images in a container div so left if position 1 and right is posi开发者_Go百科tion 5.

(ii) on sumbit save the position as a field in the database.

Some pointers would be nice, probably use jquery if possible.

Thanks.


Use jQuery UI's Sortable and it's associated methods to do a AJAX call to your server on state change.


chk this out: http://jqueryui.com/demos/sortable/#display-grid

0

精彩评论

暂无评论...
验证码 换一张
取 消