I've been working on a UI that uses SVG objects that the user can interact with.
The problem is this: jQuery UI has virtually no support for SVG. I had to build in this shim to get the SVG objects to move in the right way:
$("svg .draggable")
.draggable()
.bind('drag', function(event, ui){
event.target.setAttribute('transform',
'translate('+(((ui.position.left-rx)*k)-bb.x)+','+(((ui.position.top-ry)*k)-bb.y)+')');
});
The technique here came from a response to this question.
This page is the implementation so far. The behaviors I've found in different mainstream browsers are these:
- In Safari, the triangle behaves as designed.
- In Chrome, the triangle jumps at the beginning of every drag, and moves slower than the cursor.
- In Firefox, the triangle jumps far at the beginning of the first drag, but the triangle moves with the cursor and doesn't jump again on subsequent draggings.
Is there some way I can make behavior more consistent? What's going on here?