Adding a function to jQuery draggable revert “event”
What I have: I have a draggable div with a revert parameter set as "invalid". What I need: When the revert occurs I want to trigger a CSS change to another element. The problem: "revert" is parameter rather than an event so I'm experiencing great difficulty in triggering the required CSS change when the revert occurs. My code: $('#peg_icon').draggable({ revert: 'invalid', scroll: false, stack: "#peg_icon", drag: function(event, ui) { $('#peg_icon').css('background-image','url(images/peg-icon-when-dragged.png)'); } }); What I've tried: I've unsuccessfully attempted using "revert" as an event: