嗨,我目前正在尝试整理我的一些代码:
$('#b1').css('background-image', 'url("site_images/05/1.png")');
$('#b2').css('background-image', 'url("site_images/05/2.png")');
$('#b3').css('background-image', 'url("site_images/05/3.png")');
$('#b4').css('background-image', 'url("site_images/05/4.png")');
$('#b5').css('background-image', 'url("site_images/05/5.png")');
$('#b6').css('background-image', 'url("site_images/05/6.png")');
$('#b7').css('background-image', 'url("site_images/05/7.png")');
它工作得很好,但想知道是否有更好的选择或方法?