I am trying to create a web application for booking seats using SVG. Imagine, I created rectangles in svg, which is an empty space. I want to allow the user to drop the html element "image" to "rect" in order to reserve space.
However, I could not get droppable to work on SVM elements. Anyone have an idea why this is so? Here is the code:
$('#target').svg(); var svg = $("#target").svg('get'); svg.rect(20, 10, 100, 50, 10, 10, { fill: '#666', class: "droppable" }); $('rect') .droppable({ accept: '.product', tolerance: 'touch', drop: function (event, ui) { alert('df'); } }
source share