话不多说,直接上代码。 关键:通过点击来改变thisindex ,又thisinde == index来控制class是否含active来控制样式 简单效果如下: 转载于:https://www.cnblogs.com/vickya/p/8657629.html