福州海康笔试

海康威视 福州业务
多选
seo优化
大题(手写代码)
1.使用flex实现

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        body {
            padding0;
            margin0;
            text-aligncenter;
        }
        
        header,
        footer {
            width100%;
            background-color#f00;
            line-height48px;
        }
        
        main {
            width100%;
            line-height500px;
            displayflex;
        }
        
        .aside {
            width480px;
            background-color#ff0;
        }
        
        .content {
            width100%;
            background-color#0ff;
        }
    </style>
</head>

<body>
    <header>header</header>
    <main>
        <div class="aside">aside</div>
        <div class="content">content</div>
        <div class="aside">aside</div>
    </main>
    <footer>footer</footer>
</body>

</html>
2.使用promise实现红灯绿灯黄灯交替闪烁 红灯,3s一次 绿灯 1s一次 黄灯2s一次
现有函数
 function red(){console.log('red')}
 function green(){console.log('green')}
 function yellow(){console.log('yellow')}
代码
function red() {
    console.log('red')
}

function green() {
    console.log('green')
}

function yellow() {
    console.log('yellow')
}

function redP() {
    return new Promise(function(resolve, reject) {
        red();
        setTimeout(function() {
            resolve(greenP())
        }, 3000);
    })
}

function greenP() {
    return new Promise(function(resolve, reject) {
        green();
        setTimeout(function() {
            resolve(yellowP())
        }, 1000);
    })
}

function yellowP() {
    return new Promise(function(resolve, reject) {
        yellow();
        setTimeout(function() {
            resolve(redP())
        }, 2000);
    })
}

redP();
3.写一个防抖
#笔试题目##海康威视##题解#
全部评论

相关推荐

06-04 09:27
门头沟学院 Java
点赞 评论 收藏
分享
评论
2
8
分享

创作者周榜

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