luke_nukem_3d

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

1 Newbie

About luke_nukem_3d

  • Rank
    Newbie
  1. luke_nukem_3d

    Draggable element catching up to cursor

    Brilliant that looks perfect, thanks so much for your help, will try and implement this in my scenario. Can i just say, really appreciate the quick help you guys offer. Absolutely brilliant.
  2. luke_nukem_3d

    Draggable element catching up to cursor

    Hi Carl, thanks for your quick reply. The demo is rather a simplified version of the actual problem (which does not involve the behaviour with the hovering triggering the expansion), it was just a way of recreating my actual problem in a very simplistic fashion. My actual use case, does use the hitTest() method to determine whether the container should expand or not, and that part of it works very smoothly. Its just that if that container expands by a large amount then your draggable object is suddenly nowhere near your mouse pointer. Due to the way that my data is bound to the DOM elements, its not really possible to position the Draggable object absolutely, although I can see that would be a possible solution. Apologies for the over simplified Code Pen as I think it caused some confusion.
  3. luke_nukem_3d

    Draggable element catching up to cursor

    Hi there, I'm having what I would have thought to be a common problem, but can't find a neat solution to it. I have created a simple recreation of it in the code pen below. Try dragging the blue draggable into the grey square, and when you are over the grey square allow the mouse to come outside the draggable slightly which will let the grey box expand. When the box expands the draggable is now far behind the pointer (probably the distance the box has expanded). I want to get the draggable to catch up with the mouse pointer. Have tried tweening by a calculated distance in the 'onDrag' hook, but this seems to cause it to keep jumping back and forth. Thanks in advance for any help anyone can give me, really appreciated.