/
index2.html
36 lines (32 loc) · 963 Bytes
/
index2.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Tutorial jQuery | EL Creative Academy</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<p>Ini paragraf.</p>
<button type="button" class="tombol-up">Slide Up Paragraf</button>
<button type="button" class="tombol-down">Slide Down Paragraf</button>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
// Menampilkan pesan alert setelah slide up paragraf
$(".tombol-up").click(function(){
$("p").slideUp("slow", function(){
// Kode untuk dijalankan
alert("Efek Slide Up selesai.");
});
});
// Menampilkan pesan alert setelah slide down paragraf
$(".tombol-down").click(function(){
$("p").slideDown("slow", function(){
// Kode untuk dijalankan
alert("Efek Slide Down selesai.");
});
});
});
</script>
</body>
</html>