Selectable

Selectable

Hi,

I'm playing around with the selectable feature. I grabbed most of this from an example. I want the background color of the selected element to change to red, but when I choose another element, the background color should return to original, and let the new selected element be red. How can I do this?

  1. $(function() {
  2. $("#selectable").selectable({
  3. stop: function(){
  4. var result = $("#select-result").empty();
  5. $(".ui-selected", this).css("background","red");
  6. $(".ui-selected", this).each(function(){
  7. var bg = $("#selectable img").css('.hello');
  8. var index = $("#selectable img").index(this);
  9. result.append(" #" + (index + 1));
  10. });
  11. }
  12. });
  13. });