Hi Maya,

I'm think you can't do that because scriptaculous manage the z-index
property so while dragging the dragged element is always on top and is
forced to a specific z-index (equal to 1000).

Otherwise, you'll have to manually set the z-index property yourself.
take care, this property is only efffective to element with "relative"
or "absolute" CSS position.

To update the z-index after a change in the sortable, just use
prototype DOM function like Element.firstDescendant() [1] and
Element.next() [2] to update the DOM.
When you set the z-index property, just use Element.setStyle
({zIndex:'100'}) [3].

related link:
[1] http://prototypejs.org/api/element/firstDescendant
[2] http://prototypejs.org/api/element/next
[3] http://prototypejs.org/api/element/setStyle

ther a quicker method : $$('a method to find each li') [4] which
select all your li and return an array of Element. Then with
"each" [5] or even better "invoke" [6], you can set the z-index value
you want.

related link:
[4] http://prototypejs.org/api/utility/dollar-dollar
[5] http://prototypejs.org/api/enumerable/each
[6] http://prototypejs.org/api/enumerable/invoke

hope that help


On 9 juin, 21:00, Maya <devinpar...@hotmail.com> wrote:
> Hi,
> How can you specify the z-index for a sortable list so that the first
> list element is the highest number and the last list element is the
> lowest.  I would also like the z-index to resort itself as the user
> resorts the list items. So if the bottom list element is moved to the
> top, it's z-index would update to be the highest number.
> Any help would be greatly appreciated as I can't seem to find much
> abou this.
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to