开发者

jQuery: Sortable nested list?

i'm building a website which has a parent-child Paging structure. I'm looking for a convenient way to administrate the website structure.

Releasing the jQuery sortable code on my generated sitemap (nested UL), doesn't work properly...

$('ul.SiteMap ul').sortable();

What's really important is that it should not be possible to sort outside of the current UL. Any suggestions?

Thanks in advance.


It works fine for me. I just assigned each ul to be sorted to a class and then did the following:

$('.sortableList').sortable();


Have you tried with:

items: 'ul > li'

?

You have to list all ULs, though:

$('ul.SiteMap ul, ul.sitemap ul ul, ul.sitemap ul ul ul').sortable({
items: 'ul > li'
});

I am a beginner, so there is perhaps a better option.


Changing order of children within a parent is easy just give each ul a class '.sort' and do $('.sort').sortable();

I gets a little trickier when changing the parent.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜