Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9195305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:36:00+00:00 2026-06-17T21:36:00+00:00

I have jquery sortable lists within lists. In the example below, I want to

  • 0

I have jquery sortable lists within lists. In the example below, I want to sort the fruits with respect to each other and the cars with respect to each other, but cars may not mix with fruits.

Also, the Cars and the Fruit categories should also be sortable so that Cars can be moved above Fruits. In that case, if you move Fruits, apples and bananas should move with it.

Fruits
    apples
    bananas
Cars
    ford
    volvo

I have:

<ul id="sortable">
    <li>Fruits
        <ul id="sortable" > 
          <li > Apples  </li> 
          <li >bananas  </li> 
        </ul>
    </li> 
    <li >Cars
        <ul id="sortable" > 
          <li > Ford  </li> 
          <li >Volvo  </li> 
        </ul>
    </li> 
</ul>

Cars and fruits can be moved properly, taking their items with them, but the fruits and cars do not stay with their own kind.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:36:02+00:00Added an answer on June 17, 2026 at 9:36 pm

    I figured it out.

    If I do this, then the lists mix:

     $( "#sortable" ).sortable();
    

    But they do not mix if I put a div with id = “my_id” around the whole thing and then do

    $( "#my_id ul" ).sortable();
    

    Another way is to surround each ul with a div. Then they can have the same id.

    Another way is to give the lists different ids:

     $( "#sortable1",  "#sortable2" ,  "#sortable3").sortable();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple JQuery sortable lists that connect with each other... They allow you
In this jQuery example: http://jqueryui.com/demos/sortable/#empty-lists , they have CSS tags for each of the
I have modified example connected-lists from jquery site http://jqueryui.com/sortable/#connect-lists below: <!doctype html> <html lang=en>
I'm working with a demo of two sortable jquery lists... but have a problem
I have a page with multipe jquery sortable lists, each of these lists has
Simple question about Jquery-UI sortable lists (http://jqueryui.com/demos/sortable/#default) I have made: <ul id=sortable> <li class=ui-state-default>An
I have a page using jQuery with some lists which have been made sortable.
I have two sortable lists in jQuery. They're called sortable1 and sortable2. They are
I tried many things but not successful :( I have two sortable lists connected
I have two lists of elements, and I have enabled jQuery UI sortable on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.