Search code examples
jquerysvgsnap.svg

How to move svg image with dragging another element?


I'm wondering if that possible to move an image which under another element with dragging. I don't know how to describe it clearly, please take a look on the demo bellow.

https://jsfiddle.net/david7418/o497akje/10/

I want to trigger drag event form the top of transparent photo and move the another photo under it but not itself.

 $(function() {
       obj = Snap(".cat");
       //Enable drag event
       obj.drag();
 }

Any ideas would be greatly appreciated.


Solution

  • You can use

    pointer-events:none 
    

    with css to make an svg element not create a mouse event.