SVG Drag and Drop

This week as part of some prototyping for work, I put together a quick demo of an SVG path element that can be dragged by clicking and holding.

I also did a little experimenting with some object-oriented Javascript and was very happy with how it turned out. The “Movable” object could be used to drag any SVG element as long as you know what its DOM parent is.

I put it on “CSSDeck” (although locally I’m just running on my machine with Coda), which is a pretty cool little site that lets you host up a demo with minimal effort. Here’s the link: http://cssdeck.com/labs/paradigm72-svg-drag/0

Leave a Reply