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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:25:24+00:00 2026-05-19T02:25:24+00:00

EDIT: Here’s a link to show you my sample code: http://www.singingeels.com/jqtest/ I have a

  • 0

EDIT: Here’s a link to show you my sample code: http://www.singingeels.com/jqtest/

I have a very simple page that references jquery-1.3.2.js, ui.core.js (latest version) and ui.draggable.js (also latest version).

I have a div that I can drag around very easily (using the mouse of course):

<div id="myDiv">hello</div>

and then in JavaScript:

$("#myDiv").draggable();

This is works perfectly. But, I need to be able to simulate a ‘drag and drop’ using code alone. I have it mostly working, but the problem is that the events that are firing are the placeholder events.

If you open “ui.core.js” and scroll to the bottom… you’ll see this:

// These are placeholder methods, to be overriden by extending plugin
_mouseStart: function(event) { },
_mouseDrag: function(event) { },
_mouseStop: function(event) { },
_mouseCapture: function(event) { return true; }

Why aren’t the events being extended properly in my simulation, but when you click down with the mouse, they are? – Any ideas on how to force the _mouseDrag: property to obey the overriding extension in “ui.draggable.js”?

Solving this would be huge – and I plan to show the major benefits later.

Thanks,
-Timothy

EDIT: Here’s a link to show you my sample code: http://www.singingeels.com/jqtest/

EDIT 2: Click that link above and view-source… you’ll see what I’m trying to do. Here’s a snippet:

$(document).ready(function() {
    var myDiv = $("#myDiv");

    myDiv.draggable();

    // This will set enough properties to simulate valid mouse options.
    $.ui.mouse.options = $.ui.mouse.defaults;

    var divOffset = myDiv.offset();

    // This will simulate clicking down on the div - works mostly.
    $.ui.mouse._mouseDown({
        target: myDiv,
        pageX: divOffset.left,
        pageY: divOffset.top,
        which: 1,

        preventDefault: function() { }
    });
});
  • 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-19T02:25:25+00:00Added an answer on May 19, 2026 at 2:25 am

    There’s a question in the JQuery forum about it. It’s not resolved at the time of writing, but may have more information in the future.


    EDIT: It was answered on the forum:

    I recommend you use the simulate plugin which is what jQuery UI uses for unit testing drag and drop:

    https://github.com/jquery/jquery-ui/blob/master/external/jquery-simulate/jquery.simulate.js

    You can see examples of use by looking at the unit tests

    https://github.com/jquery/jquery-ui/blob/master/tests/unit/draggable/core.js

    https://github.com/jquery/jquery-ui/blob/master/tests/unit/draggable/events.js

    Thanks to rdworth for that.

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

Sidebar

Related Questions

EDIT: See this in action here: http://jsbin.com/emobi/5 -- and that's using mouseenter/mouseleave. I have
[EDIT: Here's a link to a mockup of what I'm trying to create] http://i53.tinypic.com/w9v2np.jpg
Edit: You can get the full source here: http://pastebin.com/m26693 Edit again: I added some
EDIT: Here's the video showing the problem: www.youtube.com/watch?v=5ZZsuMH5T9k I'm really stuck here :/ --
Here's my redirect rule: RewriteCond %{HTTP_HOST} ^mydomain\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$ RewriteRule ^somedir\/?(.*)$ http\:\/\/mydomain\.com\/newdir\/somedir\/$1
Here's a sample: http://jsbin.com/idepo/5 The padding and everything seems to look better when not
Edit - here are some resources in response to comments: costate: http://bamafolks.com/randy/students/embedded/dynamicC_mtask.html writeUserBlockArray: http://ftp1.digi.com/support/documentation/html/DynCFunctionReference/12fun595.htm#1259708
Edit: The code here still has some bugs in it, and it could do
EDIT - The code looks strange here, so I suggest viewing the files directly
EDIT Sorry I forgot the most important part here. Each key can have more

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.