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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:02:43+00:00 2026-05-30T18:02:43+00:00

I have several sortable lists connected together, so I can drag one item from

  • 0

I have several sortable lists connected together, so I can drag one item from one list and put it in another. Every list also has one item at its bottom that is neither sortable nor a drop target, making it impossible to drop any items below it.

That’s the intended use, I want the excluded item at the bottom of each list to always stay at the bottom.

Problem is if I empty a list, say I drag out all of its items and place them in another list, so that all that is left is the non-sortable item. If I then drag a new item into it it will always go to the bottom, below my non-sortable, not-a-drop-target item.

Is it possible, when dropping an new item into a sortable list that only has one non-sortable, not-a-drop-target, item, to have it be placed at the top of the list?

Example code:

$('.segment ol').sortable({
  connectWith: '.segment ol',
  distance: 25,
  items: 'li:not(.disabled)'
});

HTML:

    <div class="segment">
      <ol>
        <li>word word word</li>
        <li>word word word</li>
        <li class="disabled">must stay at bottom</li>
      </ol>
    </div>
    <div class="segment">
      <ol>
        <li class="disabled">must stay at bottom</li>
      </ol>
    </div>

If you were to drag a “word word word” li to the other list it would get appended below the disabled li.

  • 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-05-30T18:02:44+00:00Added an answer on May 30, 2026 at 6:02 pm

    You can use the “receive” event on the sortable list (when you supply options), and do something like this:

    $('.segment ol').sortable({
        connectWith: '.segment ol',
        distance: 25,
        items: 'li:not(.disabled)',
        over: function(event,ui){ ui.placeholder.insertBefore($(this).children('li.disabled:first')); }
    });
    

    That will make the currently dragged element prepend itself onto the list (prepend and prependTo will effectively move an item unless you clone it first).

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

Sidebar

Related Questions

I'm having several lists that are sortable and I can drag elements to each
I have several log files of events (one event per line). The logs can
I have several sortable tables on a page. Most of them are connected but
I have several same HTML elements going one after another: <span>1</span> <span>2</span> <span>3</span> I'm
I have several sounds, how can I play them one by one. When I
I have several questions regarding forms and PHP but if I should put them
I have several hosts from which i want to do the same query. So
I have several objects, like products, order, etc. When I get information from my
I have several LESS files that are all imported into one master file (styles.less).
I have several Rails Active Record Models: ContactEmails, ContactCalls, ContactPostalcards. Each one represent a

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.