How to addClass and removeClass with every item that gets dragged and dropped?

How to addClass and removeClass with every item that gets dragged and dropped?

Hello guys,

I would like to show a different background image every time I drop a draggable into the drop area. With this in place I can give the illusion that a bag is getting full.

This is what I have so far:

  1. $basket.droppable({
  2. drop: function(event, ui) {
  3. var $milkItem = $('#milk');
  4. var $milkItem2 = $('#milk2');
  5. var $milkItem3 = $('#milk3');
  6. if ($milkItem.is('li#milk')){
  7. $(this).removeClass('plain').addClass('plain2').end();
  8. }else if ($milkItem2.is('#milk2')){
  9. $(this).removeClass('plain2').addClass('plain3');
  10. }
  11. return false;
  12. }
  13. });


Can someone point me in the right direction.

I would also like to add dollar values to those items and have them add up.

Thanks