是否添加一个页面生成一个蓝色div
`
document.body.appendChild(shade);
var cancel = document.querySelector(“.btn.cancel”);
cancel.onclick = function() {
document.body.removeChild(shade);
}
var confirmDiv = document.querySelector(“.btn.confirm”);
confirmDiv.onclick = function() {
var a = document.createElement(“div”)
a.style.backgroundColor = “red”;
a.style.width = “100px”;
a.style.height = “100px”;
document.body.appendChild(a);
document.body.removeChild(shade)
}
}
tanchuang.css
- {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.shade {
display: flex;
top: 0;
left: 0;
width: 100%;
height: 600px;
background-color: rgba(0, 0, 0, 0.5);
}
.shade .popwindows {
width: 400px;
height: 300px;
background-color: #f2f2f2;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
}
.shade .popwindows .tltle {
position: relative;
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
flex: 1;
border-bottom: 1px solid #bdb8b8;
}
.shade .popwindows .tltle .text {
flex: 1;
float: left;
padding-left: 10px;
font-family: “微软雅黑”;
}
.shade .popwindows .tltle .exit {
width: 30px;
height: 30px;
background-image: url(“…/js学习/imag/cuohao.png”);
background-repeat: no-repeat;
background-position: center center;
background-size: 20px auto;
float: right;
margin-right: 10px;
}
.shade .popwindows .content {
width: 100%;
flex: 3;
line-height: 40px;
font-size: 13px;
margin-left: 10px;
font-family: ‘宋体’;
}
.shade .popwindows .endbtn {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
flex: 1;
border-top: 1px solid #bdb8b8;
}
.shade .popwindows .endbtn .btn{
width: 80px;
text-align: center;
height: 30px;
line-height: 30px;
font-size: 15px;
background-color: #979797;
}
.shade .popwindows .endbtn .btn:nth-child(1){
margin-right: 10px;
}
.shade .popwindows .endbtn .btn:nth-child(2){
margin-right: 10px;
}
.shade .popwindows .endbtn .btn:hover{
background-color: #f68c4e;
}
封装
添加弹窗
/*
var args = {
title:“温馨提示”,
content:“是否添加一个页面生成一个蓝色div”,
confirmDivfn:function(){
var a = document.createElement(“div”);
a.style.backgroundColor = “red”;
a.style.width = “100px”;
a.style.height = “100px”;
body.appendChild(a);
},
cancelfn:function(){
body.removeChild(shade);
}
}
*/
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数前端工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年Web前端开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上前端开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!
如果你觉得这些内容对你有帮助,可以扫码获取!!(资料价值较高,非无偿)
最后
正值金三银四招聘旺季,很多小伙伴都询问我有没有前端方面的面试题,特地整理出来赠送给大家!
本涵盖了95%以上前端开发知识点,真正体系化!**
[外链图片转存中…(img-ohrcJ2cb-1711672751675)]
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!
如果你觉得这些内容对你有帮助,可以扫码获取!!(资料价值较高,非无偿)
最后
正值金三银四招聘旺季,很多小伙伴都询问我有没有前端方面的面试题,特地整理出来赠送给大家!