-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjavascript_type.php
More file actions
68 lines (55 loc) · 1.92 KB
/
javascript_type.php
File metadata and controls
68 lines (55 loc) · 1.92 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
<?php
?>
<!-- Set chức năng Javascript: hiện popup form khi nhấn nút New Laundry, ẩn form khi nhấn nút Close trên Popup form -->
<script>
// Chức năng hiện popup form khi nhấn nút New Laundry Type
document.getElementById('new_type').addEventListener('click',
function(){
console.log("hello");
document.querySelector('.bg-modal').style.display='flex';
document.querySelector('.modal-content').style.transition='all 0.75s ease-out';
document.querySelector('.modal-content').style.top='0px';
}
)
// Chức năng ẩn form khi nhấn nút Close trên Popup form
document.getElementById('close').addEventListener('click',
function(){
document.querySelector('.bg-modal').style.display='none';
}
)
</script>
<!-- Set chức năng collapse -->
<script>
var coll = document.getElementsByClassName('collapsible');
// var tes = document.querySelector('.contents');
var i;
// console.log(tes);
for (i = 0; i < coll.length; i++) {
coll[i].addEventListener('click', function() {
this.classList.toggle('actives');
var contents = document.querySelector('.contents');
// console.log(contents);
if (contents.style.maxHeight){
contents.style.maxHeight = null;
} else {
contents.style.maxHeight = '0px';
}
});
}
</script>
<!-- Set chức năng detete -->
<script>
var coll = document.getElementsByClassName('remove');
var i;
for (i = 0; i < coll.length; i++) {
coll[i].addEventListener('click', function() {
var contents = document.querySelector('.main');
contents.style.maxHeight = '0px';
});
}
</script>
<!-- <script
src='https://code.jquery.com/jquery-3.6.0.slim.js'
integrity='sha256-HwWONEZrpuoh951cQD1ov2HUK5zA5DwJ1DNUXaM6FsY='
crossorigin='anonymous'>
</script> -->