When I drop it over the target, how do I make it stay there?

2 posts, 0 answers
  1. Joe Sugden
    Joe Sugden avatar
    52 posts
    Member since:
    Feb 2010

    Posted 14 Mar 2012 Link to this post

    And disappear from original position?
    And then move it inside the target from one spot to another?
  2. Tim
    Tim avatar
    3 posts
    Member since:
    Mar 2012

    Posted 25 Mar 2012 Link to this post

    Can you post code?

    This method seems a bit like smoke and mirrors and there may be a better way (and if there is I hope someone shares :)), but you can try the following:

      hint: $('#foo').clone(),
      dragstart: function () {
      drop: function (e) {
            top: e.clientY,
            left: e.clientX

    In this example I use the 'body' as the drop target and use absolute positioning to determine the final resting place of '#foo' once I drop it.  To give the illusion that I'm dragging '#foo', I clone it (for the drag), hide it while dragging, and then show it again once it's been dropped.

    Hope this has helped!
Back to Top