-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFadeIn-FadeOut
More file actions
45 lines (36 loc) · 1.16 KB
/
FadeIn-FadeOut
File metadata and controls
45 lines (36 loc) · 1.16 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
<!doctype html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="author" content="Flavio Couto">
<meta name="description" content="Curso desenvolvimento Web André Fontenelle">
<title>FadeIn/FadeOut</title>
<style>
#janela { width:300px; height:300px; background-color:#069; margin-top:20px }
</style>
<script src="jquery-3.2.1.min.js"></script>
<script>
//aparecer e sumir com fadein e fadeout
$( function(e) {
$('#mostrar').click( mostrarObjeto )
$('#esconder').click( esconderObjeto )
$('#reverso').click( reversoObjeto )
})
function esconderObjeto() {
$('#janela').fadeOut(500);
}
function mostrarObjeto() {
$('#janela').fadeIn(500);
}
function reversoObjeto() {
$('#janela').fadeToggle(500);
}
</script>
</head>
<body>
<input type="button" id="mostrar" value="Fade in" />
<input type="button" id="esconder" value="Fade out" />
<input type="button" id="reverso" value="Fade in/out" />
<div id="janela"></div>
</body>
</html>