3.8
总的来说很少问八股,基本从项目入手,然后考虑一个场景,怎么去实现这个场景
4. 项目中文件切片怎么切的,断点续传怎么续的,如何显示进度等等
刚要写动画,我就开始道歉,给面试官说我马上有个会要开,本来以为就直接终止算了,但是面试官很好,跟我又约了时间
3.11(接着上次写)
写的时候遇到不会的,面试官让我查,就这样边查边写边改bug。。。。
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <style> #con { width: 200px; height: 200px; background-color: skyblue; position: absolute; transition: 2s; } .container { width: 400px; height: 200px; background-color: red; display: flex; justify-content: space-evenly; } .son { width: 50px; height: 50px; animation: move linear 2s alternate-reverse infinite } /* .son1 { background-color: skyblue; } .son2 { background-color: blue; } .son3 { background-color: pink; } */ .son:nth-child(1) { background-color: skyblue; } .son:nth-child(2) { background-color: blue; } .son:nth-child(3) { background-color: pink; } @keyframes move { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(150px); } } </style> </head> <body> <div id="con"></div> <!-- <div class="container"> <div class="son son1"></div> <div class="son son2"></div> <div class="son son3"></div> </div> --> </body> <script> let con = document.getElementById("con"); // let timer = setInterval(() => { // leftval += 10 // con.style.left = leftval + "px"; // if (leftval == 40) { // clearInterval(timer) // } // }, 1000) //改写上面的代码,用setTimeout来实现setInterval var leftval = 0 function move() { leftval += 30 con.style.left = leftval + "px"; } function mySetinterval(fn, delay) { let timer; const interval = function () { fn(); console.log("@@@") timer = setTimeout(interval, delay); } timer = setTimeout(interval, delay); return () => { clearInterval(timer); } } let clearinterval = mySetinterval(move, 1000); </script> </html>
差不多一小时了,开始反问
最后:面试官很不错,虽然我很菜,但是面试官会耐心引导。即使是kpi面,也是一次和大牛交流的机会嘛。