循环点击换图片
$('.switch').click(function(){
$('.switch').removeClass('speriod');
$('.switch').addClass('divide'); //不被点击的变黑
$(this).removeClass('divide');
$(this).addClass('speriod'); //点击的变蓝
var a = $(this).find('img').attr('src'); //点击的
// console.log(b);
if( a== 'images/icon/singlexin.png'){
$(this).find('img').attr('src','images/icon/singlexin.png');
$('.a').find('img').attr('src','images/icon/fen.png');
}else if(a== 'images/icon/fen.png'){
$(this).find('img').attr('src','images/icon/fenxin.png');
$('.b').find('img').attr('src','images/icon/single.png');
}else if( a== 'images/icon/single.png'){
$(this).find('img').attr('src','images/icon/singlexin.png');
$('.a').find('img').attr('src','images/icon/fen.png');
}else if(a== 'images/icon/fenxin.png'){
$(this).find('img').attr('src','images/icon/fenxin.png');
$('.b').find('img').attr('src','images/icon/single.png');
}
});
<div class=" clf speriod switch b" style="margin-right:11px;"><i>¥</i>20000.00<img src="images/icon/singlexin.png"></div>
<div class="clf divide switch a"><i>¥</i>20000.00<img src="images/icon/fen.png"></div>