views:

120

answers:

1

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

+1  A: 

Can you post the HTML and CSS? Are you using the right classes?

Andres