var max_z = 0;
$$('div').each(function(elm){
var z = elm.getStyle('z-index');
max_z = (z <= max_z) ? max_z : z;
});
If you can scope your $$ to a smaller universe, or use $
('foo').select('div') instead, you might be able to shave some cycles
off of that. Another approach would be to do this once at page load,
then each time you add a new "top" element, increment the max_z global
variable to match. You just want to keep building higher, there's no
reason to worry about decrementing when you remove the top element.
Walter
> --
> You received this message because you are subscribed to the Google
> Groups "Prototype & script.aculo.us" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/prototype-scriptaculous/-/z1S97SMUSZkJ
> .
> To post to this group, send email to prototype-s...@googlegroups.com
> .
> To unsubscribe from this group, send email to prototype-scripta...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en
> .
--
You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group.