2018-8-28 18:25:27

jQuery 参考:https://www.cnblogs.com/liwenzhou/p/8178806.html

2018-8-28 19:53:19

还是讲的jQuery !

有点点枯燥!但是很好理解!

这几天想多看看书!电脑玩的太多!需要精心看书!

扎克伯格 说过 有时候有状态学多点,没状态就干点其他的!

越努力,越幸运!

<!DOCTYPE html>
<html>
<head>
<title>位置相关方法</title>
<meta charset="utf-8">
<style type="text/css">
* {
margin: 0;
padding: 0;
}
.c1{
height: 100px;
width: 100px;
background-color: red;
}
</style>
</head>
<body>
<div class="c1">我是div</div>
<script src="jquery-3.2.1.min.js"></script>
<script type="text/javascript"></script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>自定义模态框</title>
<meta charset="utf-8">
<style type="text/css">
.cover{
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: rgba(0,0,0,0.4);
z-index: 998;
} .modal{
height: 400px;
width: 600px;
background-color: white;
position: absolute;
top: 50%;
left: 50%;
margin-left: -300px;
margin-top: -200px;
z-index: 1000;
}
.hide {
display: none;
}
</style>
</head>
<body>
<button id="b1">屠龙宝刀,点击就送</button>
<div class="cover hide"></div>
<div class="modal hide">
<form action="">
<p>
<label>用户名:
<input type="text" name="">
</label>
</p>
<p>
<label>密码:
<input type="text" name="">
</label>
</p>
<p>
<input type="submit" value="登入">
<input id="cancel" type ="button" value="取消">
</p>
</form>
</div> <script src="jquery-3.2.1.min.js"></script>
<script type="text/javascript">
// 找到点击弹出模态框的按钮
$("#b1").click(function(){
// 把 .cover和.modal显示出来(去除hide)
$(".cover").removeClass("hide"); // 显示背景
$(".modal").removeClass("hide"); //显示模态框
})
// 找到取消按钮,绑定事件
$("#cancel").click(function(){
//给背景和模态框都加上hide类
$((".cover").addClass("hide");
$((".modal").addClass("hide");
})
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>修改css样式</title>
<meta charset="utf-8">
</head>
<body>
<p>小强</p>
<p>二哥</p>
<script src="jquery-3.2.1.min.js"></script>
<script type="text/javascript">
$("p").click(function(){
//把当前点击的标签变绿
// 在处理事件的函数中用this 表示 当前触发事件的标签
$(this).css("color","red");
$(this).css("font-size","24px");
}) </script>
</body>
</html>

最新文章

  1. io.js的服務器突破
  2. Maven Repository
  3. centos配置163源
  4. 【转】内部Handler类引起内存泄露
  5. Python的安装与基本语法
  6. SRM 409(1-250pt, 1-500pt)
  7. hiho #1079 : 离散化
  8. spring整合redis客户端及缓存接口设计(转)
  9. 一个三维点类Gpoint3的实现
  10. 基于跳跃表的 ConcurrentSkipListMap 内部实现(Java 8)
  11. Linux 使用nexus搭建maven私服
  12. Python文件读写之r+/w+/a+
  13. 【mmall】Guava库学习Collections
  14. dedecms调用子栏目及文章列表
  15. 机器学习技法笔记:15 Matrix Factorization
  16. mmu裸机程序
  17. 使用命令行执行sql文件
  18. Daily Scrum 10.21
  19. [转]-[携程]-A Hybrid Collaborative Filtering Model with Deep Structure for Recommender Systems
  20. 优化升级logging封装RotatingFileHandler

热门文章

  1. BarTender表单的人性化设计—分组框
  2. 存储过程打印超过8000的VARCHAR字符的问题
  3. 本地推送UILocalNotification(转)
  4. mongodb 关闭服务器
  5. Lab6: Paxos
  6. iOS 关于信鸽推送点击推送通知的处理
  7. script 里写 html 模版
  8. [Ubuntu] 关于使用 root 账号登录
  9. cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration的解决
  10. 随心所欲玩复制 详解robocopy