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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:40:49+00:00 2026-06-16T03:40:49+00:00

I have a sortable list in which are several elements that need to be

  • 0

I have a sortable list in which are several elements that need to be able to be reordered by the user.

Alternatively the elements can also be dragged onto 5 available dropzones (droppable containers).

The problem I am encountering is this: When the drop is successfully done on a droppable zone, the revert animation of the sortable is still playing animating the dropped element back into the sortable list.

Instead I would like to animate it in a way that the helper is taken from where the drop occurred and then animated into the droppable zone, sort of like dragging a file into the Trash on a Mac.

For the latter to work however I’d need to:

  1. On successful drop, stop the revert animation.
  2. Copy the coordinates of the dropped element and launch custom animation to the center of the droppable element.

The issue is within part (1), draggable allows the ‘invalid’ or ‘valid’ flags on revert but sortable doesn’t.

Any ideas on how I can achieve 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-16T03:40:50+00:00Added an answer on June 16, 2026 at 3:40 am

    So after a bit of back and forth I’ve managed to resolve this by cloning the original ui.helper element (that sortable creates) and using this clone (which isn’t being reverted back obviously) to finish the custom animation sequence while removing the original helper and placeholder (created by sortable) to hide sortable‘s revert animation.

    It’s not quite as clean as I would’ve preferred it because I’m effectively still letting the sortable‘s revert function execute (rather than cancelling it) but until someone has a better idea this works.

    Code below:

    // default sortable interaction/setup.
    $('.sortable-list').sortable({
      placeholder: 'sortable-list__item sortable-list__item--placeholder',
      revert:      true,
      helper:      'clone',
      tolerance:   'pointer',
      connectWith: '.sortable-list',
      appendTo:    'body',
      zIndex:      1000
    });
    
    // dropzone interaction will grab the ui.helper from sortable clone it and then
    // reuse it for it's own finish animation while removing the helpers from the
    // sortable list and dom.
    $('.dropzone')
      .droppable({
        accept:      '.sortable-list__item',
        hoverClass:  'dropzone--hover',
        activeClass: 'dropzone--active',
        tolerance:   'pointer'
      })
      .on('drop', function(event, ui) {
        var $item   = ui.draggable, // this is the original item.
            $helper = ui.helper;    // this is the cloned item the user drags
    
        // clone the helper instance and position it in the same exact spot where
        // the user had left it using the ui.position
        // (or ui.offset depending on your nesting/positioning of the helper)
        var $clone  = $helper.clone().css({ 
              "position": "absolute",
              "top":      ui.position.top,
              "left":     ui.position.left
            }).appendTo('body');
    
            // cleanup the original helper (remove from stage) and hide placeholder
            // elements. We're hiding the latter because the revert callback of 
            // sortable is removing it for us and will otherwise throw an error that
            // the placeholder can't be removed because it no longer exists in the DOM.
            $helper.remove();
            $('.sortable-list__item--placeholder').hide();
    
        // launch into your own animation sequence using the $clone of $helper
        // and process the drop data accordingly.
    
      });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of elements which I would like to make sortable and
I have draggable list of < li > elements which I'm able to drag
i have a form and a sortable() list where a user can drag from
Basically I have a draggable list which is connected with a sortable list. Works
I have two lists. They are sortable but not connected (elements of list one
I have a list which is numbered. When sorting the items I need to
I have two lists in which using jQuery sortable i can move the items
I have a list of menu items which can be sorted. I have the
With jQuery sortable, I have a very long list which forces a scrollbar. Whenever
I have multiple sortable lists that are dynamically generated from a list in MySQL.

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.