-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
65 lines (59 loc) · 1.87 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="A clock writen by canvas"/>
<meta name="keywords" content="Canvas, Clock">
<meta name="author" content="Torvalds">
<title>Canvas Clock</title>
<link rel="stylesheet" href="clock.css">
</head>
<body>
<div>
<canvas id="clock" height="200px" width="200px"></canvas>
</div>
<p id="demo"></p>
<img src="images/WechatIMG396.png" alt="" id="image" height="200px" width="200px">
<script type="text/javascript" src="clock.js"></script>
<!-- <script type="text/javascript">
window.onload = function AlertDialog(){
// document.write("JS进阶篇");//输出
var r = confirm("关注JS高级篇");//弹出确认框
var txt;
if (r == true) {
txt = "You pressed OK!";
} else {
txt = "You pressed Cancel!";
}
document.getElementById("demo").innerHTML = txt;
}
</script> -->
<script type="text/javascript">
window.onload = function AlertDialog(){
// document.write("JS进阶篇");//输出
var txt;
if (confirm("关注JS高级篇")) {
txt = "You pressed OK!";
} else {
txt = "You pressed Cancel!";
}
document.getElementById("demo").innerHTML = txt;
};
// var img=new Image();
// img.onload=function() {
// var iheight=img.height;
// var iwidth=img.width;
// alert(iwidth);
// };
// img.src="images/WechatIMG396.png";
var image=document.getElementById('image');
image.onload=function() {
var iheight=image.height;
var iwidth=image.width;
alert(iwidth);
};
</script>
</body>
</html>