fengchuanyu 8 mēneši atpakaļ
vecāks
revīzija
f7a0aa7b21

+ 1 - 1
6_css3/6_动画.html

@@ -22,7 +22,7 @@
             }
             50%{
                 width: 300px;
-                
+                height: 100px;
             }
             100%{
                 width: 300px;

+ 2 - 0
7_HTML5/4_canvas.html

@@ -7,6 +7,7 @@
     <style>
         canvas{
             background-color: #000;
+        
         }
     </style>
 </head>
@@ -16,6 +17,7 @@
         var oCan = document.getElementById("canv");
         var can = oCan.getContext("2d");
         can.strokeStyle="white";
+        can.lineWidth = 3;
         can.moveTo(10,10);
         can.lineTo(200,200);
         can.lineTo(100,300);

+ 27 - 0
7_HTML5/5_获取元素新方法.html

@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+<body>
+    <div class="box">hello</div>
+    <div id="div1">world</div>
+    <span>你好</span>
+
+    <script>
+        // var oBox = document.getElementsByClassName("box");
+        // oBox[0].innerText = "你好"
+
+        var oBox = document.querySelector(".box");
+        var div1 = document.querySelector("#div1");
+        var oSpan = document.querySelector("span");
+        // var oDiv = document.querySelector("div");
+        var aDiv = document.querySelectorAll("div");
+        // console.log(oBox,div1,oSpan);
+        // console.log(oDiv);
+        // console.log(aDiv[1]);
+    </script>
+</body>
+</html>

+ 22 - 0
7_HTML5/6_cookie.html

@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>Document</title>
+</head>
+<body>
+    <script>
+        var timer = new Date();
+        // console.log(timer.getDate());
+        timer.setDate(timer.getDate()+2)
+        document.cookie = "username=小明;Expires="+timer.toUTCString();
+        document.cookie = "password=123;Expires="+timer.toUTCString();
+        document.cookie = "message=hello;Expires="+timer.toUTCString();
+        console.log(document.cookie);
+        var resArr = document.cookie.split(";");
+        console.log(resArr[1].split("=")[0]);
+
+    </script>
+</body>
+</html>

+ 33 - 0
7_HTML5/练习题1_画板.html

@@ -0,0 +1,33 @@
+<!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>
+        #can{
+            background-color: #000;
+        }
+    </style>
+</head>
+<body>
+    <canvas id="can" width="400" height="300"></canvas>
+    <script>
+        var oCan = document.getElementById("can");
+        var can = oCan.getContext("2d");
+        can.strokeStyle = "white";
+        can.lineWidth = 3;
+
+        oCan.onmousedown = function(e){
+            can.moveTo(e.clientX,e.clientY);
+            oCan.onmousemove = function(e){
+                can.lineTo(e.clientX,e.clientY);
+                can.stroke();
+            }
+            oCan.onmouseup = function(){
+                oCan.onmousemove = null;
+            }
+        }
+    </script>
+</body>
+</html>