I overcame this by binding to the click event for my draggable. I then
set the z-index of the draggable to the maximum z-index of the other
draggables plus 1.
$("#myDraggable").bind("click", function(e){
var largestZ = 1; // this is the min z-index you would want to
apply to the draggable
$(".otherDraggables").each(function(i) {
var currentZ = parseFloat($(this).css("zIndex"));
largestZ = currentZ > largestZ ? currentZ : largestZ;
});
$("#myDraggable").css("z-index", largestZ + 1);
});
I still think there should be an option to bring a draggable to the
front of a stack on click as opposed to hacking it like this.
On Jul 13, 5:26 pm, WR <[email protected]> wrote:
> How would I bring adraggableto the top of a stack of draggables on
> theclickevent? The current behaviour only brings adraggableto the
> front when you drag the element.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---