Skip to content

Instantly share code, notes, and snippets.

@sanooj
Created September 2, 2011 09:40
Show Gist options
  • Save sanooj/1188270 to your computer and use it in GitHub Desktop.
Save sanooj/1188270 to your computer and use it in GitHub Desktop.
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