[ACCEPTED]-How to add multiple CSS elements to a div using jQuery?-css
Accepted answer
You're thinking correctly. Using the css(map)
method 4 is the way to go.
$(".cIconSmall").css({
float: "left",
width: "59px",
background: "transparent url('http://download.com/47.jpg') no-repeat scroll -132px -1px"
});
A map of property-value 3 pairs to set.
Might be nicer as a css class, though... then 2 you can just write $(".cIconSmall").addClass("icon47");
but there's a time for 1 everything...
$(".yourClass").css({
float: "left",
width: "59px",
background: "transparent url('http://download.com/47.jpg') no-repeat scroll -132px -1px"
});
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.