我在点击()时让背景图像换出有点麻烦
$('.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()
在 firebug 中返回被点击的正确元素,但$(this).addClass('box-selected')
不会改变当前点击元素的背景。
有任何想法吗?
TIA