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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:24:06+00:00 2026-06-14T07:24:06+00:00

I am having difficulty activating JQuery UI draggable and droppable elements. I am using

  • 0

I am having difficulty activating JQuery UI draggable and droppable elements. I am using Twitter Bootstrap as well as Jinja2 for templating. Here is my html:

      <div class="well sidebar-nav">
        <ul class="nav nav-list">
          <li class="nav-header">communities</li>
          {% for community in communities %}
            <li class='draggable'><a href="http://localhost:8080/users/{{community}}">{{community}}</a></li>
          {% endfor %}         
        </ul>
      </div><!--/.well -->
      <div class="well sidebar-nav">
        <ul class="nav nav-list">
            <li class='droppable'><i class="icon-trash"></i><span class="label label-warning">trash</span></li>   
        </ul>
      </div><!--/.well -->

I am trying to make the elements of the sidebar-nav called ‘communities’ draggable into the sidebar-nav called ‘trash’. Here is the JQuery:

$('.draggable a').on('mouseover', function(){
    $(this).draggable();
});

$('.droppable i').on('mouseover', function(){

    drop: function( event, ui) {

        $('#dialog').dialog()

    }

});

The reason I used .on() to activate the communities is to allow for the user to dynamically add more. The problem I am having with this code is that neither the draggables nor droppables are activated by it, but when I move to the console and activate the draggables with $(‘.draggable a’).draggable(), they are activated.

I guessed that this issue stemmed from the html elements loading after the JQuery was executed. I moved the JQuery to the end of the page and surrounded it with $(document).ready(function(){…}), to no effect. Then surrounded the script with $(window).bind(“load”, function() {…}), also to no effect.

I am at a loss and would appreciate some input.

  • 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-14T07:24:08+00:00Added an answer on June 14, 2026 at 7:24 am

    First of all I believe your problem may be that you are not calling droppable() on your droppable container. The javascript you provide produces errors, which may be why your droppable and draggable elements are not activated. Here is an example, jsfiddle. It is not pretty and it doesn’t take into consideration Bootstrap or Jinja2, but it demonstrates what you are after.

    You’re right, you need to make sure the the draggable and droppable js is executed after any initial DOM modifying JS. I don’t believe calling draggable() or droppable() using the on() event is buying you anything. If new DOM elements are added after your script has run then you will still need to attach the on() event to those elements as well. You will be just as well off attaching the desired ui action directly and ditching the on() event, unless I’m missing something and you need them for some other reason.

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

Sidebar

Related Questions

I am having difficulty using JQuery UI Modal Dialog when submitting a form. The
I am having difficulty setting up a simple html file using javascript to display
I'm having difficulty implementing an accordion effect on three different tables using jQuery and
I'm having difficulty parsing some JSON data returned from my server using jQuery.ajax() To
Having difficulty checking (checkbox) all nodes by a specific class here is what i
I'm having difficulty constructing a non-www to www permanent redirect. Here are the conditions
I'm having difficulty in switching between xibs :( first i was using navigationController and
I am having difficulty downloading the Android source code using the recommended instructions, due
I am having difficulty in consuming the reCaptcha Web Service using C#/.Net 3.5. Although
I am having difficulty updating a table via PHP. Using MySQL prompt or 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.