Skip to content

Instantly share code, notes, and snippets.

@SubZane
Forked from bytehead/last_child.js
Created February 24, 2014 10:47
Show Gist options
  • Save SubZane/9185471 to your computer and use it in GitHub Desktop.
Save SubZane/9185471 to your computer and use it in GitHub Desktop.
// there is a solution for jQuery < 1.9.0, where you can use `$.browser`:
// https://gist.github.com/nathansmith/950767
// but jQuery removed `$.browser` in version 1.9.0, so you have to get another way:
function last_child() {
if (/msie [1-8]{1}[^0-9]/.test(navigator.userAgent.toLowerCase())) {
$('*:last-child').addClass('last-child');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment