题解 | #切换Tab栏目#

切换Tab栏目

http://www.nowcoder.com/practice/70916dc9292e470eb70ac2a0d3b9a404

options.onclick = function(e) {
    optionItems.map((item, index) => {
        if (index == e.target.getAttribute('data-type')) {
            item.style.backgroundColor = '#25bb9b';
            items[index].style.display = 'block';
        } else {
            item.style.backgroundColor = '#fff';
            items[index].style.display = 'none';
        }
    })
}
全部评论

相关推荐

点赞 评论 收藏
转发
14 收藏 评论
分享
牛客网
牛客企业服务