Skip to content

Instantly share code, notes, and snippets.

@irazasyed
Forked from sanooj/browser detect
Created November 21, 2012 17:42
Show Gist options
  • Save irazasyed/4126384 to your computer and use it in GitHub Desktop.
Save irazasyed/4126384 to your computer and use it in GitHub Desktop.
jQuery: Browser Detect for html
$(document).ready(function()
{
if ( $.browser.msie ){
if($.browser.version == '6.0')
{ $('html').addClass('ie6');
}
else if($.browser.version == '7.0')
{ $('html').addClass('ie7');
}
else if($.browser.version == '8.0')
{ $('html').addClass('ie8');
}
else if($.browser.version == '9.0')
{ $('html').addClass('ie9');
}
}
else if ( $.browser.webkit )
{ $('html').addClass('webkit');
}
else if ( $.browser.mozilla )
{ $('html').addClass('mozilla');
}
else if ( $.browser.opera )
{ $('html').addClass('opera');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment