I want to run function insertHouse() when dropping div#Draggable. I can’t manage to make it work. You can see me trying to call it in the second line from the bottom. What am I doing wrong?
<img src="images/door1.jpg" id="draggable">
<div id="items"></div>
// Place house;
function insertHouse()
{
blablabla
}
$( init );
function init() {
$('#makeMeDraggable').draggable();
$('body').droppable( {
drop: handleDropEvent
} );
}
function handleDropEvent( event, ui ) {
function insertHouse();
}
Following code will work…