题解 | #切换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';
        }
    })
}
全部评论

相关推荐

05-14 09:40
已编辑
西安邮电大学 golang
redf1sh:默认会git结果发现真不会,这种一看就是没做过项目的,真做过项目的至少会提交
点赞 评论 收藏
分享
MrGaomq:你沟通的太少了,我两个号沟通了都1w多了
点赞 评论 收藏
分享
评论
14
收藏
分享

创作者周榜

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