Link to home
Create AccountLog in
Avatar of codequest

asked on

Drag Clone won't swap

In the attached test code, the intent is for the drag clone to change images when the drag goes back forth over the 400px left mark.

The 400px left point is recognized, and the CheckSwap function is evoked, but the drag clone just disappears.   It will appear if the drag is started on the right side of the page, but it won't drag, again indicating again that the CheckSwap function is evoked.

I tried other approaches like changing image but no joy.

Any help with getting this to swap the drag clone as the drag goes back and forth pass the 400px left mark OR, providing an explanation for why it can't work OR coming up with a different approach, would be appreciated.

Avatar of Kyle Hamilton
Kyle Hamilton
Flag of United States of America image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of codequest


Wow!  Works slick!  Happy happy!

FYI for future readers, I was able to delete this from CheckSwapDragClone. = (X - (.5 * parseInt(, 10))) + 'px'; = (Y - (.5 * parseInt(, 10))) + 'px';
        document.onmousemove = dragMove;

Open in new window