可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
i'm building a website which has a parent-child Paging structure. I'm looking for a convenient way to administrate the website structure.
- I want the pages to be sortable
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.
回答1:
It works fine for me. I just assigned each ul to be sorted to a class and then did the following:
$('.sortableList').sortable();
回答2:
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.
回答3:
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.