JQuery: addClass() not changing background on selector
- by centr0
im having a little trouble getting the background image to swap out on click()
$('.highlight-boxes li a[class!=selected-box]').click(function() {
$('.highlight-content').hide();
$('.highlight-boxes li a').removeClass();
$(this).addClass('box-selected'); // problem here
var selected = $(this).attr('href').substr(1);
$('#' + selected).stop(true,true).fadeIn();
return false;
});
console.log() in firebug returns the correct element being clicked but $(this).addClass('box-selected') does not change the background of the currently clicked element.
any ideas?
TIA