相关的js代码:
$('#control-part-1').click(function(){
$(this).css('backgroundColor','#fff');
$('#part-1').css('display','block');
$(this).siblings().css('backgroundColor','#eee');
$('#part-1').siblings('.right-part').css('display','none');
});
$('#control-part-2').click(function(){
$(this).css('backgroundColor','#fff');
$('#part-2').css('display','block');
$(this).siblings().css('backgroundColor','#eee');
$('#part-2').siblings('.right-part').css('display','none');
});
$('#control-part-3').click(function(){
$(this).css('backgroundColor','#fff');
$('#part-3').css('display','block');
$(this).siblings().css('backgroundColor','#eee');
$('#part-3').siblings('.right-part').css('display','none');
});
$('#control-part-4').click(function(){
$(this).css('backgroundColor','#fff');
$('#part-4').css('display','block');
$(this).siblings().css('backgroundColor','#eee');
$('#part-4').siblings('.right-part').css('display','none');
});
我的:
大众点评的: