题解 | #切换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
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务