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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:15:55+00:00 2026-05-24T18:15:55+00:00

I am using class for setting draggable and droppable properties of the element (UL,

  • 0

I am using class for setting draggable and droppable properties of the element (UL, LI or DIV). So i can drag and drop as intended when i create the elements at design time. But when i create a element on the fly ( A div with id=’ontheflyDiv’ ) is not working as droppable.

Thanks in advance.

<html xmlns="">
<head>
    <title></title>
    <link rel="stylesheet" href="/Styles/themes/base/jquery.ui.all.css">
    <script src="/Scripts/jquery-1.6.2.js"></script>
    <script src="/Scripts/ui/jquery.ui.core.js"></script>
    <script src="/Scripts/ui/jquery.ui.widget.js"></script>
    <script src="/Scripts/ui/jquery.ui.accordion.js"></script>
    <script src="/Scripts/ui/jquery.ui.mouse.js" type="text/javascript"></script>
    <script src="/Scripts/ui/jquery.ui.draggable.js" type="text/javascript"></script>
    <script src="/Scripts/ui/jquery.ui.droppable.js" type="text/javascript"></script>
    <link rel="stylesheet" href="/Styles/demos.css">
    <script>

        $(function () {

        //Draggable Items
            $(".myDragClass").draggable({
                helper: 'clone',
                appendTo: 'body'
            });
        //Droppable
            $(".myDropClass").droppable(
                {
                    drop: function (event, ui) {
                        //remove old item
                        $(this).find(".myDragClassPlaceHolder").remove();

                        var listHtml = "<li class='myDragClass' style='width: 200px;color:#000000;background-color:#00FF00;'>" +
                                        "<div id='ontheflyDiv' class='myDropClass' style='width:200px;height:100px;'>" +                                        
                                        "New Droppable area" + ui.draggable.text() + "</div></li>";

                        $(this).append(listHtml);
                    }
                });

       });
    </script>
</head>
<body>
    <div id="div3" class="demos-nav">
        <ul class="myDropClass">
            <li id="li7" class="myDragClassPlaceHolder">Drag and drop order here</li>
        </ul>
    </div>
    <BR />
    <div id="Div1" style="float: none; clear: both; font-size: 12px; height: 100px; overflow: scroll;">
        <table>
            <tr>
                <td><B><U>Order No</B></U></td>
            </tr>
            <tr>
                <td>
                    <div class="myDragClass">5000162255</div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="myDragClass">
                        5000162266</div>
                </td>
            </tr>
        </table>
    </div>
</body>
</html>
  • 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-24T18:15:58+00:00Added an answer on May 24, 2026 at 6:15 pm

    I think you need to make your newly appended element droppable by calling droppable() on it after your’ve added it to the DOM. if you add something like this:

        $(this).find('#ontheflyDiv').droppable( { ... }); 
    

    to the bottom of your drop function it should work. I’m not aware of a way to add droppable functionality to elements added after page load similar to what jquery’s live() function can do for click and other events.

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

Sidebar

Related Questions

i load a class using Class.forName(klassname,false,loader) After this i create an instance using klass.newInstance();
I want to create a new object using Class::DBI. One of the fields of
Perhaps I'm using $.data incorrectly. Assigning the data: var course_li = sprintf('<li class=draggable course>%s</li>',
I am trying to create a Matrix class using c++. So far, I have
I need to set the properties of a class using reflection. I have a
i am using a jquery plugin to create some draggable objects. the plugin is
Using a class that has an xmlrpc proxy as one of it's object's properties
I've got a class that I'm using as a settings class that is serialized
I'm using a singleton class to save all my settings info. It's first utilized
I save stuff in an Isolated Storage file (using class IsolatedStorageFile). It works well,

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.