Im using this code:
$(this).css('backgroundcolor', localStorage.getItem('bgColorr') + " !important;");
When i write:
alert( localStorage.getItem('bgColorr') + " !important;");
It gives me the proper alert, rgb(243,102,42) !important; ....
Really getting to me.. thanks guys!
edit:
Surrounding code:
$(function() { $(this).css('background-color', localStorage.getItem('bgColorr')); });
var colorOptions = '#000, #fff, #abf7ae, #f6cbe9, #53c68f, #53c1c6, #538dc6, #c6536b'.split(', '), colorDivs = [], colorsContainer = $('#colorsContainer');
for ( var i = 0, len = colorOptions.length; i < len; i++ ) { var div = $('').css('background', colorOptions[i])[0]; colorDivs.push(div); }
colorsContainer.append(colorDivs);
$('#header').hover(function() { colorsContainer .fadeIn(200) .children('div') .click(function() { $('body').css('background', $(this).css('backgroundColor')); localStorage.setItem('bgColorr', $(this).css('backgroundColor')); });
}, function() { colorsContainer.fadeOut(200); });
There you go, thanks guys