2009/9/18 Max Felker <felk...@gmail.com>:
>
> I had an idea after working on a photo gallery and needing to obtain
> the last descendant of a element. I whipped this up and wanted to see
> what everyone thought.
>
>  lastDescendant: function(element) {
>    var descendant_array = $(element).descendants();
>    var array_length = descendant_array.length-1;
>    return descendant_array[array_length];
>  },
>
> One thing I was curious about was the last line where it returns the
> element. Should this be extended with the $ utility?
>
>
> >
>

http://api.prototypejs.org/language/array.html#last-instance_method

var o_LastDescedant = $(elements). descendants().last();

-- 
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to