I have a <div> that on occasion has an inline background attribute applied to it.
I would like to be able to check if there is an inline style attached to it, and if there is then I want to go ahead and attach a background-position.
Is there a way that I can check explictly for inline backgrounds applied to $(this)?
if ($(this).css('background').length > 0) {
console.log('has a background');
// set a background position
$(this).css('background-position', 'center 22px');
}
I bet something like this might work