My code has some divs that appear on the screen based on different actions. The divs have handles that make them draggable via the jquery ui.draggable code. I have the draggable ui stack option set, so that when you drag an item, it automatically moves to the front of all other draggable items.
The problem I am having is that I want a div moved to the front even if you just click on the handle, without dragging it anywhere. I've tried triggering various events when the handle is clicked, such as mousedown, mousemove, mouseup, drag, dragstart and dragstop, but none seem to do the trick. I've also tried just changing the z-index values, but that also hasn't worked well so far.
My code looks something like this. Say I have the div, and the handle is an h5 tag. I have instantiated the draggable function already. So I have:
$("div.window h5").click(function() {
$(this).parents("div:first").trigger("whatever event i am trying");
)};
But this isn't working. (I've also tried putting the trigger on the h5 itself instead of the parent div). I am not seeing an errors, I am just not getting the desired result.
Thanks in advance for any help!