Home & blog  /  Tag: animation  /

Roundup: animated table sort / browser sniffing

posted: 07 Nov '11 07:04 tags: table, sort, animation, browser, sniff, plugin, navigator

With the exception of Blockster, the most popular script I've ever posted is my animated table sorter.

Which is rather odd, since as far as I'm aware it's buggy. Somehow, though, if the comments and e-mails are anything to go by, loads of people have been able to use it just fine.

Given this unexpected popularity I'm going to attempt to rebuild it in the coming months.

This script is among the top five hardest scripts I've written, so I'll, er, look forward to that.

In other news, stay tuned for my next script, later this week - a browser and plugin sniffer.

Browser sniffing is one of those things that you can't believe there still isn't a standard way of doing. Even jQuery's $.browser utility comes with a load of caveats warning that results might not be as expected.

And it's little wonder. Different browsers declare different, non-standard data in the various properties of the navigator object. Over the years these have led to some amusing revelations; if you ask Chrome what its navigator.appName is you'll get... Netscape. Naturally.

So I've been labouring away on a script that will provide you with something representing a reliable utility for this sort of thing. Not only with regards to detecting browser name but also other info such as language (more on that later...) and plugin support (and on that...).

post a comment

Bouncy text plugin

posted: 03 Feb '11 16:42 tags: text, effect, animation, bounce, jQuery

Some months ago I posted my Spraycan plugin. Just when you thought I couldn't post anything more pointless, I give you my bouncy text plugin.

This, erm, does what it says on the tin. You point it at some text on your page via jQuery selector, and it randomly makes the letters in that element bounce up and down.

Head over here to download, get usage info or view a demo.

It works in all IEs, Firefoxes and Operas, but currently not Chrome or Safari. How about that? Something works in IE6 but not Chrome. Rather amusing.

I will try to get out more.

post a comment

Table sort update - sorting on child element

posted: 17 Jul '10 13:01 tags: table, sort, animation, Javascript, jQuery, child

The reception to my animated table sort plugin, posted a few weeks ago, has been great. A number of blogs, articles and tweets have featured it.

Some people have asked if it's possible to sort on the content of a child element of each . It wasn't - but it now is, via a new parameter: child, which should be a selector string to match the element.

So if each in column 1 contained a text field, and you wanted to sort on the current values of those textfields, you'd could run:

1$('#example1_table').sortTable({

2     onCol: 1,

3     keepRelationships: true,

4     child: 'input'

5});

It's important that your selector matches only one element per , else the sort will fail. If in doubt, be more specific with your selector, e.g.

child: 'input.mytextfield'

Head over here to download, get usage info or view a demo.

post a comment

Table sort - now REGEXP friendly

posted: 14 Jun '10 10:52 tags: table, sort, Javascript, jQuery, animation, REGEXP

Just modified my animated table sort plugin to allow sorting on a regular expression match against the content of each .

This would be hugely useful if, say, you had a table showing product categories and, for each, the number of products therein, in brackets, e.g. "Lawnmowers (15)".

You can also specify an index of the returned matches array to use for the sort, in case your REGEXP pattern returns more than one match or specifies a sub-pattern.

Head over here to download, get usage info or view a demo.

post a comment