Andrew
Andrew

Reputation: 35

Jquery drag drop z-index

I am using a Jquery Drag Drop UI script on page elements that are restricted by a container, I was just wondering if there was a way to always place the dragged div on top of the other child draggable elements.

Javascript function:

function dragIT(parent){
$("#"+parent).draggable({ containment: "#dashboard", scroll: false });
}

This function is called by the child/div - onmousedown / ondrag. However, dragged elements are sometimes hidden behind other divs which is something I don't want.

Upvotes: 0

Views: 924

Answers (1)

qw3n
qw3n

Reputation: 6334

http://jqueryui.com/demos/draggable/#visual-feedback has an example

function dragIT(parent){
$("#"+parent).draggable({ containment: "#dashboard", scroll: false, stack:"#"+parent+" div" });
}

Upvotes: 2

Related Questions