-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiv.html
More file actions
87 lines (64 loc) · 2.49 KB
/
Copy pathdiv.html
File metadata and controls
87 lines (64 loc) · 2.49 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!Doctype html>
<HTML>
<HEAD>
<title>divjs</title>
</HEAD>
<body>
<span id="box" style="font-size: 10px;" onclick="redimensionner();">Mon prénom est : Alshaolin</span>
<script type="text/javascript">
var box = document.getElementById('box');
var compteur = 0;
function redimensionner(){
if
(compteur == 0) {
box.style.fontSize = '120px';
box.style.color = 'silver';
compteur = 1;
}
else{
box.style.fontSize = '30px';
box.style.color = 'green';
compteur = 0;
}
}
function change() {
var conteneur = document.getElementById('conteneur');
conteneur.style.backgroundColor = "green";
}
function hide(){
conteneur.style.display = "none";
}
function display(){
conteneur.style.display = "";
}
function height(){
if (compteur==0) {
conteneur.style.height = "110px";
compteur = 1;
}
else if (compteur == 1) {
conteneur.style.height = "300px";
compteur = 2;
}
else{
conteneur.style.height = "100px";
compteur = 0;
}
}
</script>
<div id="conteneur" style="background-color: blue; height:100px; width:100px;" ></div>
<button type="button" id="btn1" onclick="height()">Bouton 1</button>
<button type="button" id="btn2" onclick="change()">Bouton 2</button>
<button type="refresh" id="btn3" onclick="window.location.reload();">Bouton 3</button>
<button type="button" id="btn4" onclick="hide()">Bouton 4</button>
<button type="button" id="btn5" onclick="display()">Bouton 5</button>
<style type="text/css">
#btn1 {
}
#conteneur{
position: absolute;
top: 200px; left: 600px;
}
</style>
</body>
</HTML>