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 7830885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:27:00+00:00 2026-06-02T11:27:00+00:00

I am trying to implement jquery UI nested sortables with more than one UL.

  • 0

I am trying to implement jquery UI nested sortables with more than one UL. Below is the code,

   <html>
    <head>
    <script type="text/javascript" src="js/jquery-1.5.2.js"></script>
    <script type="text/javascript" src="js/jquery-ui-1.8.16.custom.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){   
    $("#example5 ul").sortable({
                    connectWith: "#example5 ul",
                    placeholder: "ui-state-highlight"
    });

    $("span.item-controls").click(function(){
        //alert($(this).parent().next('div').attr('class'))
        var v = $(this).parent().next('div.panel');
        v.slideToggle("slow");
      });

    });
    </script>
    <style>
    ul { 
        min-height:10px; 
        }
    li {
        margin:5px;
        width:auto;
        border:1px solid #000;
        list-style-type:none;
        cursor:move;
    }

    #example5 {
          display: inline-block;
          float: left;
          position: relative;
          width:900px;
    }
    .fright
    {
          float:right;
    }
    .item-controls {
          cursor: pointer;
          font-size: 12px;
          position: relative;
          right: 20px;
          top: 5px;
          background: url("images/arrows.png") no-repeat scroll transparent;
          xborder: 1px solid #000;    
          background-position:3px 0px;
          width:20px;
          height:15px;
    }.ui-sortable{
    margin:0px;padding:0px;
    }
    .ahead
    {
         margin:0px;
    }
    div.panel
    {
        height:auto;
        display:none;
    }
    div.panel
    {
        margin:0px;
        text-align:center;
        background:#e5eecc;
        border:solid 1px #c3c3c3;
    }
    </style>
    </head>

    <body>
    <div id="example5"><!--UL1-->
        <ul style="width:32%;float:left;" class="navigation">
             <li ><p class="ahead"><span class="heading">Item 1 </span><span class="fright item-controls"></span></p>
                     <div class="panel">
                        <p>This is Item 1</p>
                    </div>
                <ul>
                    <li >
                    <p class="ahead"><span class="heading">Item 1 1</span><span class="fright item-controls"></span></p>
                     <div class="panel">
                        <p>This is Item 1 1</p>              
                    </div>              
                    <ul></ul></li>
                    <li >Item 1 2<ul></ul></li>
                    <li >Item 1 3<ul></ul></li>
                 </ul>

             </li>
             <li >
             <p class="ahead"><span class="heading">Item 2 </span><span class="fright item-controls"></span></p>
                    <div class="panel">
                        <p>This is Item 2</p>       
                    </div>       
             <ul><li >Item 2 1<ul></ul></li></ul>
             </li>
             <li >Item 3<ul></ul></li>
             <li >Item 4<ul></ul></li>
        </ul>
    <!--UL2-->
        <ul style="width:32%;float:left;"  class="navigation2">
             <li ><p class="ahead"><span class="heading">Item 1 </span><span class="fright item-controls"></span></p>
                     <div class="panel">
                        <p>This is Item 1</p>
                    </div>
                <ul>
                    <li >
                    <p class="ahead"><span class="heading">Item 1 1</span><span class="fright item-controls"></span></p>
                     <div class="panel">
                        <p>This is Item 1 1</p>              
                    </div>              
                    <ul></ul></li>
                    <li >Item 1 2<ul></ul></li>
                    <li >Item 1 3<ul></ul></li>
                 </ul>

             </li>
             <li >
             <p class="ahead"><span class="heading">Item 2 </span><span class="fright item-controls"></span></p>
                    <div class="panel">
                        <p>This is Item 2</p>       
                    </div>       
             <ul><li >Item 2 1<ul></ul></li></ul>
             </li>
             <li >Item 3<ul></ul></li>
             <li >Item 4<ul></ul></li>
        </ul>
<!--UL3-->
           <ul style="width:32%;float:left;"  class="navigation3">
             <li ><p class="ahead"><span class="heading">Item 1 </span><span class="fright item-controls"></span></p>
                     <div class="panel">
                        <p>This is Item 1</p>
                    </div>
                <ul>
                    <li >
                    <p class="ahead"><span class="heading">Item 1 1</span><span class="fright item-controls"></span></p>
                     <div class="panel">
                        <p>This is Item 1 1</p>              
                    </div>              
                    <ul></ul></li>
                    <li >Item 1 2<ul></ul></li>
                    <li >Item 1 3<ul></ul></li>
                 </ul>

             </li>
             <li >
             <p class="ahead"><span class="heading">Item 2 </span><span class="fright item-controls"></span></p>
                    <div class="panel">
                        <p>This is Item 2</p>       
                    </div>       
             <ul><li >Item 2 1<ul></ul></li></ul>
             </li>
             <li >Item 3<ul></ul></li>
             <li >Item 4<ul></ul></li>
        </ul>
    </div>
    </body>
    </html> 

So far so good,got the expected result. Now my requirement is, From UL-1 should not be sortable with UL-2 and UL-3 also from UL-2,UL-3 should not be sortable together.Hope you understand the requirement. Is it possible to do that. Kindly advice on this.

  • 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-02T11:27:01+00:00Added an answer on June 2, 2026 at 11:27 am

    Try use this way

    $("#example5 ul").sortable({
        connectWith: "#example5 ul.navigation *",
        placeholder: "ui-state-highlight"
    });
    

    So your target will be always your main UL and remains are just for sortable elements.

    Note:

    I added different class names to your html part to use this solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement a JQuery script to process some areas inside an image
I'm trying to implement a jQuery AJAX script to open a link in a
I am trying to implement jQuery UI droppable and sortable example into one of
I'm trying to implement a Jquery Javascript menu onto a webpage. Jquery code: $(.navigation
I'm trying to implement a validation script (bassistance) with a jquery form wizard (
I'm trying to implement JQuery datatables in my play application. Here is my code
I am trying to implement the jquery selectbox script. I have made all the
since Google translate api will stop working i'm trying to implement some jquery code
I'm currently trying to implement jquery tablesorter and one of my columns is filesizes,
i'm trying to implement the jquery autocomplete plugin. I've got it up and running,

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.