第一节课

饥人谷JS Bin

1. css animation

html:

1
<p></p>

css:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
p {
height:100px;
width:300px;
background:#eee;
animation-duration: 3s;
animation-name: slidein;
}

@keyframes slidein {
from {
width:100px;
height:200px;
background:black;
}

to {
width:300px;
height:100px;
background:#eee
}
}

2. window.open

html:

1
2
<button id=myButton>点我</button>
<button id=myButton2>点我2</button>

js:

1
2
3
4
5
6
7
8
9
10
11
myButton.onclick = function(){
let windowObjectReference =
window.open('http://baidu.com','sb',
'width=400,height=400,top=100,left=100');
}

myButton2.onclick = function(){
let windowObjectReference =
window.open('http://qq.com','sb',
'width=400,height=400,top=100,left=100');
}

3. 进制转换

十进制 ——> 二进制
23(10)——> 10111(2)
0.25(10)——> 0.01(2)

二进制 ——>十六进制,每四个二进制代表一个十六进制数
0001 ——> 1,0010 ——> 2,0011 ——> 3,0100 ——> 4,
0101 ——> 5,0110 ——> 6,0111 ——> 7,1000 ——> 8,
1001 ——> 9,1010 ——> A,1011 ——> B,1100 ——> C,
1101 ——> D,1110 ——> E,1111——> F

二进制 ——> 十六进制
1001 0001(2)——> 91(16)
1101 1011(2)——> DB(16)
0001 1101 1011(2)——> 1DB(16)