Reputation: 331
I am practicing jQuery, but I can't seem to fix the CSS background. I'm trying to make like this but with different color:
Here is my fiddle:
Only jQuery code:
$(document).ready(function(){
$( "#sortable" ).sortable();
$( "#sortable" ).css({
background-color: '#000'
});
$( "#sortable" ).disableSelection();
});
I've tried to change the position too but same result, it won't load I think?
EDIT: Version: jQuery 1.9.1 jQuery UI 1.9.2
Upvotes: 1
Views: 507
Reputation: 3220
$( "#sortable" ).css({
'background-color': '#000'
});
To change the inside div colors
$( "#sortable .ui-state-default" ).css({
'background': '#efefef'
});
Upvotes: 0
Reputation: 340
Here is a correct fiddle also with fixed span positioning. http://fiddle.jshell.net/HAZ3n/7/
$( "#sortable .ui-state-default" ).css({
background: '#000'
});
Upvotes: 0
Reputation: 103425
Try
$("#sortable" ).css({
'background-color': '#000'
})
You simply forgot to put quotes on your property. You don't need to pass over a map/object to set only one property. You can just put pass it as string.
Upvotes: 2