This question is similar to others you have already asked. You have changed little details that should be part of the original question.
The problem with this code is that you’re using image
and no longer circle
like you had before. Just like both rect
and image
use coordinates x|y
the verification ddData.element.tagName == 'rect' ? 'x' : 'cx')
no longer right. You must change to ddData.element.tagName != 'circle'
.
In the other question you also had Ids on the elements you wanted to move, so you had the line of code if (!ddData.element.id) return ddData.element = null;
that no longer makes sense.
Correcting these lines the result is: http://jsfiddle.net/kpvgkrey/
And what’s the problem?
– Jorge B.
I can move the red rectangle but I can’t move an image.
– akm
http://jsfiddle.net/kpvgkrey/
– Sergio
is it possible to exchange a png for a svg @Sergio format? So change the image path?
– akm
@akm: http://stackoverflow.com/questions/1861382/convert-png-to-svg
– Sergio