Kind of new to jquery and I am working with the draggable and droppable stuff. I have two draggables and a droppable. I can't quite figure out how to make it do different things based on which box I drop. Here is my jquery:
$(function() {
$( "#greatplan" ).draggable();
$( "#droppable" ).droppable({
drop: function( event, ui ) {
$( this )
.addClass( "ui-state-highlight" )
.find( "p" )
.html( "Great Plan Picked!" )
}
});
$( "#poorplan" ).draggable();
$( "#droppable" ).droppable({
drop: function( event, ui ) {
$( this )
.addClass( "ui-state-highlight" )
.find( "p" )
.html( "Poor Plan Picked!" )
}
});
})
And my HTML:
<div id="greatplan" class="ui-widget-content">
<p>Great Plan!</p>
</div>
<br>
<div id="poorplan" class="ui-widget-content">
<p>Poor Plan!</p>
</div>
<div id="droppable" class="ui-widget-header">
<p>Drop your plan here</p>
</div>
No matter which box I drag into the droppable I always get "Poor Plan!". Any ideas?