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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:27:18+00:00 2026-06-10T05:27:18+00:00

I am using an app where you drag and drop list items between 2

  • 0

I am using an app where you drag and drop list items between 2 nested sortables: http://jsfiddle.net/jhogervorst/Ge7eK/9/

My question is how would you change the code so it copied elements from one list to the other, rather than move them? Seems like a simple change but I can’t figure it out.

Thanks.

  • 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-10T05:27:19+00:00Added an answer on June 10, 2026 at 5:27 am

    I’ve gotten it most of the way there:

    http://jsfiddle.net/Ge7eK/41/

    receive: function(event, ui){
        var ele = document.elementFromPoint(ui.position.left, ui.position.top);
        var newEle = ui.item.clone();        
        newEle.attr("id", ""); // trying to prevent duplicate ids
        $(ele).after(newEle);            
    },
    
    remove: function(event, ui){
        event.preventDefault(); // this stops the item from being removed
    }
    

    There’s a bug happening when you drag an item from, say list A to list B, then drag another item from list A over that copied item. I’m not sure why it is happening, but it may have something to do with the ids you’re using.

    Also, the drop position can be a little bit finicky. If your placeholder item is between two items in the list (instead of overlapping one slightly), it will add that item to the end of the list.

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

Sidebar

Related Questions

I am doing a little app with JQuery, using drag-n-drop for the interface. Basically,
I'm using a heavy javascript based app that uses a drag and drop feature.
I have, what should be, a simple question on drag'n'drop. I have a fresh
I want to drag and drop UIbutton in my app like iPhone main screen
I have a zip file that is created using drag and drop on a
I'm implementing simple drag-and-drop functionality in my app, and I would like to know
I'm developing an iPhone/iPad app that supports dragging items between table views. Since all
I'm using jQuery UI to create a drag and drop function for a UL.
I have a small rails app that is using acts_as_list to implement drag and
I am trying to figure out Drag And Drop using the features in the

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.