Support jQuery < 1.6 by not using $.fn.is().

Adapted from rooby's pull request for issue #1555.
Merge pull request #1702 from opensourcery/master

Remove use of `$.fn.is()` in favor of more widely supported methods.