Reputation: 10744
I want load a css or scss file of my rails 3.1 project with Jquery.browser detection.
In web page http://api.jquery.com/jQuery.browser/ I can see how set property css for example:
if ( $.browser.msie ) {
$("#div ul li").css( "display","inline" );
} else {
$("#div ul li").css( "display","inline-table" );
}
But I want can loading a CSS or SCSS FILe that I have in my project rails 3.1 depend if is browser opera, firefox, chrome, safari, ie...etc.
Upvotes: 0
Views: 433
Reputation: 10258
You can dynamically load different css files with:
$("<link/>", {
rel: "stylesheet",
type: "text/css",
href: "/styles/yourcss.css"
}).appendTo("head");
Upvotes: 2