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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:40:47+00:00 2026-06-03T21:40:47+00:00

I have a drag and drop code works perfectly on divs that have been

  • 0

I have a drag and drop code works perfectly on divs that have been created on the server side however when i create a div using jquery (dynamically) i cannot seem to drop anything into the container…

$('.dropcontent').droppable({
            accept: '.item',
            drop: function(ev, ui) {
               /* do something */
            }    
        });

        $(".item").draggable({  
           helper:'clone',
           appendTo: 'body',
           snap: true,
           revert: true

        });

    <div id="row1seo" class="dropcontent" > </div>   // original code on server side
    <div id="row1seo" class="dropcontent ui-droppable"> </div> // the above line becomes this on client side showing it has "binded" with the droppable
    <div id="row2seo" class="dropcontent"></div> // this the dynamically created div which doesn't seem to bind with the droppable. this is created in php file using ajax to retrieve it 

I have also tried

 $(".dropcontent").live('droppable', function() {
......
});

doesnt seem to work… any ideas how to fix this ?

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-03T21:40:49+00:00Added an answer on June 3, 2026 at 9:40 pm

    You have to make the drag function live so it works on generated elements. Too bad jQuery’s live() function doesnt handle drags and drops, so you have to create one yourself. I use this function for example:

    (function ($) {
        $.fn.liveDraggable = function (opts) {
            this.live("mouseover", function() {
                if (!$(this).data("init")) {
                    $(this).data("init", true).draggable(opts);
                }
            });
            return $();
        };
    }(jQuery));
    

    Call it like this:

    $( "element" ).liveDraggable()
    

    You can easily make one for droppable too! GL!

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

Sidebar

Related Questions

I have a UITextview in my Screen,I created textview in drag and drop on
I have been considering using the code example shown at Shell Style Drag and
I have a knockout binding handler that uses plupload for drag and drop and
I am having some repeating code in views, that are part of drag&drop operations.
I'm using html5 to create drag and drop image upload functionality. This works great
I have some code that works each time onmouseclick and continuously onmousemove when I
I want to drag and drop that I have drawn on the forms. Here
The problem I have is that I have an NSOutlineView with Drag and Drop
I've just started learning javascript and have created a drag and drop using jquery
I have a drag and drop handler in my Flex application. The drag proxy,

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.