[thelist] Sort DIV

Stevenson Ngila Stevenson at epr.footman-walker.com
Mon Nov 11 09:54:01 CST 2002


this works fine but it's only sorting what is in the div, not the whole
div( i.e. the id )

-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of Nik Schramm
Sent: 08 November 2002 18:49
To: thelist at lists.evolt.org
Subject: Re: [thelist] Sort DIV


On 08.Nov.02 15:42 Stevenson Ngila wrote

 > is there a way i can sort this divs by names alphabetically!

Yes, *but* only using JavaScript/DOM, so it will only work in IE and
Mozilla/NN6+ and then only if the user has JS switched on. Still, better
than nothing...

Try this: http://dev.nae.de/dom-sorting/

Note how the second example shows how alphabetical sorting using
array.sort() in JS is unable to mix the results for both lower- and
upper-case strings within the same sort. If this is important to you,
you have to write your own custom sort handler and use
array.sort(sortFunction) instead. There are numerous examples of how to
do that around the web.

--
/nik

--
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !





More information about the thelist mailing list