网易公开课学习-认识前端,从一个弹窗案例说起
2016-06-28 20:10
537 查看
你看的到的都是前端工程师开发的。
页面制作:ps切图+html+css
组件化:生产+渠道+用户
页面架构:布局解决方案+响应式+规范与模块化···
产品前端架构:协作流程+技术选型+开发实践
Alert.html源代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>弹窗</title>
<link rel="stylesheet" type="text/css" href="Alert.css">
</head>
<body>
<div class="layer" style="display:none">
<h2>提示</h2>
<p>认识前端-从一个弹窗案例说起。
愿有岁月可回首,且以深情共白头。</p>
<button>ok</button>
</div>
<button id="button">点击</button>
<script type="text/javascript" src="Alert.js"></script>
</body>
</html>
Alert.css源代码:
*{margin: 0;padding: 0;}
.layer{
width: 300px;
padding: 20px;
background: #fff;
border: 1px solid #bbb;
border-radius: 10px;
box-shadow: 0 3px 5px #bbb;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.layer h2{
font-size: 16px;
border-bottom: 1px solid #ddd;
padding-bottom: 5px;
margin-bottom: 20px;
}
.layer p{
font-size: 14px;
text-indent: 2em;
line-height: 1.5;
}
.layer button{
display: block;
width: 100px;
height: 30px;
line-height: 30px;
margin: 30px auto 0;
text-align: center;
background: #333;
color: #fff;
border: 0;
border-radius: 5px;
cursor: pointer;
}
Alert.jsl源代码:
document.getElementById("button").addEventListener(
"click",function(){
document.querySelector(".layer").style.display="block";
}
);
document.querySelector(".layer button").addEventListener(
"click",function(){
document.querySelector(".layer").style.display="none";
}
);
链接:http://study.163.com/course/courseLearn.htm?courseId=1054012#/learn/live?lessonId=1003427033&courseId=1054012
页面制作:ps切图+html+css
组件化:生产+渠道+用户
页面架构:布局解决方案+响应式+规范与模块化···
产品前端架构:协作流程+技术选型+开发实践
Alert.html源代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>弹窗</title>
<link rel="stylesheet" type="text/css" href="Alert.css">
</head>
<body>
<div class="layer" style="display:none">
<h2>提示</h2>
<p>认识前端-从一个弹窗案例说起。
愿有岁月可回首,且以深情共白头。</p>
<button>ok</button>
</div>
<button id="button">点击</button>
<script type="text/javascript" src="Alert.js"></script>
</body>
</html>
Alert.css源代码:
*{margin: 0;padding: 0;}
.layer{
width: 300px;
padding: 20px;
background: #fff;
border: 1px solid #bbb;
border-radius: 10px;
box-shadow: 0 3px 5px #bbb;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.layer h2{
font-size: 16px;
border-bottom: 1px solid #ddd;
padding-bottom: 5px;
margin-bottom: 20px;
}
.layer p{
font-size: 14px;
text-indent: 2em;
line-height: 1.5;
}
.layer button{
display: block;
width: 100px;
height: 30px;
line-height: 30px;
margin: 30px auto 0;
text-align: center;
background: #333;
color: #fff;
border: 0;
border-radius: 5px;
cursor: pointer;
}
Alert.jsl源代码:
document.getElementById("button").addEventListener(
"click",function(){
document.querySelector(".layer").style.display="block";
}
);
document.querySelector(".layer button").addEventListener(
"click",function(){
document.querySelector(".layer").style.display="none";
}
);
链接:http://study.163.com/course/courseLearn.htm?courseId=1054012#/learn/live?lessonId=1003427033&courseId=1054012
相关文章推荐
- HTML5 表单元素
- 《剑指offer》:[60]把二叉树打印成多行
- 《剑指offer》:[59]对称的二叉树
- 复选框与文字对齐的问题
- HTML5 新的 Input 类型
- html 图像映射(一个图像多个连接)
- IE8下对象数组的长度问题
- JavaScript绑定事件的方法[3种]
- Jquery的各个Ajax函数,$.get(),$.post(),$.ajax(),$.getJSON()的用法
- 《剑指offer》:[58]二叉树的下一个结点
- 关于ArcGIS API for Javascript的安装_3.17API与SDK
- 自定义顶部导航栏-样式1
- HTML5 Video(视频)
- HTML5 Audio(音频)
- css水平居中的小小探讨
- angularJS ng-grid 配置
- HTML5 Geolocation(地理定位)
- HTML5 拖放(Drag 和 Drop)
- W3C标准
- how to create igllib project independently(effective on 28/6/2016)