Skip to content

Instantly share code, notes, and snippets.

@lrobeson
Forked from bytehead/last_child.js
Created July 3, 2014 02:17
Show Gist options
  • Save lrobeson/17661d0749ff2c8f980b to your computer and use it in GitHub Desktop.
Save lrobeson/17661d0749ff2c8f980b to your computer and use it in GitHub Desktop.
Add last-child class in IE 8
// Add last-child class in IE 8
// source: https://gist.github.com/nathansmith/950767
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