This is a handy plugin. But it seems to be throwing an "expected '(' " error in IE. and not functiong correct.
FF works OK. If anyone else can confirm the but I will post a bug report. On Tue, Jun 10, 2008 at 11:55 AM, Seth - TA <[EMAIL PROTECTED]> wrote: > > Found this plugin to do the job. TinySort - > http://www.sjeiti.com/?page_id=321 > > On Jun 5, 7:29 pm, Dave Methvin <[EMAIL PROTECTED]> wrote: > > Wrap that html in a <div id="hotels"> </div> and try this code > > triggered by a button or link. > > > > function reorder(sortby, direction) > > { > > Array.prototype.sort.call($("div.hotel"), function(a,b){ > > var av = $(a).find("span."+sortby).text(); > > var bv = $(b).find("span."+sortby).text(); > > return direction=="ascending"? av-bv : bv-av; > > }).appendTo("#hotels"); > > > > } > > > > sortby is the class name of any of the spans like distance or rate; > > direction is "ascending" (low to high) or "descending". The code > > assumes the spans should always be sorted as numeric values. > > > > That code should be plenty fast for a dozen or so entries, but it > > would get slow for 100 because it requeries for the span values on > > eachsortcomparison. > -- "He's spending $300 million in advertising to convince people of something he claims there is already a consensus on.-- --Think of it as going green by getting lots of green." -Glenn Beck (CNN) about Al Gore.