$(".menu").live("click",function(){ for(var j=0;j<menu.length;j++){ menu[j].style.backgroundColor="#2B3642"; } $(this).css("background-color","#3c6c90"); var menuIdx=$(".menu").index($(this));//获得下标 相关文章: 2021-12-04 2021-12-04 2021-12-18 2021-05-25 2021-12-04 2022-12-23 2022-12-23 2021-12-04