Reputation: 381
How can I get this CSS declaration:
background: #232222 url("../img/big-team.jpg") no-repeat fixed;
In here:
$('.class ').css( 'background', ' //code should be injected here ' );
Thank you in advance!
Upvotes: 0
Views: 63
Reputation: 2051
You can also try by css Shorthand properties
$(".class").css({
"background-color":"#232222",
"background-image": "url('../img/big-team.jpg')",
"background-repeat":"no-repeat",
"background-position":"fixed"
});
Upvotes: 0
Reputation: 5201
Just copy and paste your CSS declaration:
$('.class').css('background', '#232222 url("../img/big-team.jpg") no-repeat fixed');
Upvotes: 1
Reputation: 85545
Just you use in your css like this:
$('.class ').css( 'background', '#232222 url("../img/big-team.jpg") no-repeat fixed' );
Upvotes: 0