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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:39:47+00:00 2026-05-14T00:39:47+00:00

Using jQuery 1.2.x and jQuery UI 1.5.x, one was able to trigger dragging manually

  • 0

Using jQuery 1.2.x and jQuery UI 1.5.x, one was able to trigger dragging manually like so:

jQuery("#myDiv").mousedown(function(ev) {
target = jQuery(ev.target);
if (target.hasClass("drag-me")) {
    target.draggable({
        helper: "clone",
        start: function()
        {
            console.log("drag start");
        },
        stop: function()
        {
            jQuery(this).draggable("destroy");
        }
    }).trigger("mousedown.draggable", [ev]);
} });

It is applied to the following HTML:

<div id="myDiv">
<div class="drag-me"></div>
<div class="drag-me"></div>
<div class="drag-me"></div>
<div class="drag-me"></div>
<div class="drag-me"></div>
<div class="drag-me"></div>
<div class="drag-me"></div>
</div>

It was a handy way to apply dragging to elements inside a container that has its children changed dynamically. I like to call it “drag delegation”.

However with the release of jQuery 1.3.x & jQuery 1.6+, the script above stopped working. Using jQuery 1.3.2 & jQuery UI 1.7.1 returns an error “too much recursion”.

How can I trigger dragging manually? Any suggestions?

  • 1 1 Answer
  • 1 View
  • 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-14T00:39:48+00:00Added an answer on May 14, 2026 at 12:39 am

    It turns out to be much simpler than you’d expect. Looking at the .trigger() method’s documentation, no mention is made to the fact that one can also supply the original event as an argument and not just a string representation of the event type.

    Thus one can achieve delegated dragging more efficiently like so:

    $("ul#dynamiclist").delegate("li", "mousedown", function(event) {
        $(this).draggable({
                helper: "clone",
                cursorAt: { left: 5, top: -5 },
                cursor: "move",
                stop: function() {
                        $(this).draggable("destroy");
                }
        }); });
    

    The ideal solution would have been for the UI library to have some method to perform this type of delegation natively for dynamic elements….

    Note that this is applicable to jQuery 1.4.2 & jQuery UI 1.7.2

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

Sidebar

Related Questions

I am using JQuery Localizer plugin. That plugin has a one function defined like
I am using jquery mobile. I would like to navigate from one page to
I would like to be able to cycle anchor selection using jQuery 1.4.4. The
Im using jquery and want each form text input to appear one by one,
I create one table by using jquery : <div class=productlist style=float:left; id=productlist> <script type=text/javascript
I'm using jQuery UI Themes with one of my web applications. If I want
How can one select a specific sibling of a context node using jQuery? Specifically,
I'm using jQuery tabs. In one of the tabs is a wysiwyg editor that
I have created tabs by using jQuery API and have bound one event handler
I am using jquery fullcalendar which works great. The one issue I have is

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.