Drag & Drop Problem...
Drag & Drop Problem...
Hi everyone! I am a jQuery newbie, and looking for a little help.
I am making a drag & drop application. But I have run into a few problems which bring up a few questions.
First of all, I have a box inside of a box. The main box is called .bullpen, the boxes inside the bullpen are . . . bpstore under there, I have created 6 smaller boxes that are called driverbox. The problem I have encountered is I cannot get all the bpSTORE's to be draggable.I can get one of them to be draggable. But not all of them.
$( init );
function init() {
$('#bpstore').draggable({
helper: 'clone',
appendTo: 'body',
containment: "document"
});
$('.driverbox').droppable( {
drop: handleDropEvent
} );
}
function handleDropEvent( event, ui ) {
var draggable = ui.draggable;
alert( 'The square with ID "' + draggable.attr('id') + '" was dropped onto me!' );
}
My next question is how do I make each of the store boxes unique? The div is named all the same. So that I can write them to a database individually?
Thanks in advance for your help!