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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:49:51+00:00 2026-05-12T07:49:51+00:00

I have draggable list of < li > elements which I’m able to drag

  • 0

I have draggable list of < li > elements which I’m able to drag into another empty < ul > element. If I drag the first < li > element of the draggable original < ul > everything works fine…

Problem:

…but when I drag any other < li > element of that list the ‘helper’ moves away from the mouse pointer as soon as I cross the border of the recieving sortable < ul >. More precicely it moves up to the top of the list.

Has anyone seen this and knows a solution?
Well, my problem is, I’m just using jquery, not really deeply into it and never really used javascript in depth either.

More info about the problem:

My jQuery code:

$(document).ready(function() {
    $('#roleList > li').draggable({
        connectToSortable: '#roleDrop',
        containment: '#container',
        revert: 'invalid'
    });                   
    $('#roleDrop').sortable({
        cursor: 'move',
        containment: '#container',
        revert: true,
        update: function() {
            var order = $('#roleDrop').sortable('serialize');
            $.ajax({
                type: 'POST',
                url: '".$postUrl."',
                dataType: 'html',
                data: order
            });
        }                          
    });
    $('#roleList').disableSelection();
});

While #roleList and #roleDrop are the aforementioned unordered lists, #container is a table.

Now a screenshot of what happens.

I start dragging the item:

http://drop.io/download/public/dkabw5hlq3yfm0f84yji/7bf91122adc241373a5da13b5bde4b231644c1c5/da142000-ff76-012b-41ee-f10bc9db08a6/5a1bfa70-68f6-012c-6d08-f2025930ce6a/v2/thumbnail_large

When I cross the border of the second < ul > the helper jumps up.

http://drop.io/download/public/dkabw5hlq3yfm0f84yji/2fad1d633d38cf593da46c638d1930431ea5fd35/da142000-ff76-012b-41ee-f10bc9db08a6/5c65c4c0-68f6-012c-6601-f12da00d9d47/v2/thumbnail_large

If you need the xhtml markup too, please tell me.

  • 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-12T07:49:52+00:00Added an answer on May 12, 2026 at 7:49 am

    Try adding helper: 'clone' to your .draggable options:

    $('#roleList > li').draggable({
        helper: 'clone',
        connectToSortable: '#roleDrop',
        containment: '#container',
        revert: 'invalid'
    });                   
    

    According to the jQuery documentation, you should set this option when connecting a draggable to a sortable.

    While this yields a different interface experience (dragged items are cloned instead of moved), it’s at least a temporary workaround for what the documentation implies is a known problem. Additional event handling could clean the original item out of #roleList during the #roleDrop update callback.

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

Sidebar

Related Questions

I have some elements on a page which are draggable. These same elements have
I have created a specific List which exists out of the following elements to
I have a draggable div element with a hover style. This works fine, but
Is it possible to have a draggable element with more than one handle? I
I have a ListView containing file names. These file names need to be draggable
Have just started using Visual Studio Professional's built-in unit testing features, which as I
I have a few functions which I load in the ready() event. These basically
I have an IFrame on my page pointing to a page containing list of
I have a page where i have a sortable list of items (a div
Good day! I right now have a function the drags an element from 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.