-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
86 lines (62 loc) · 2.4 KB
/
index.js
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
// hover event
const tableD = document.querySelectorAll(' .t-agentposte .bodyt');
const tablp=document.querySelectorAll('.t-agentposte .poste');
// var btn=document.getElementById('btaj')
var id=""
var idp=""
const btn=document.getElementById("btaj")
for (let index = 0; index < tableD.length; index++) {
tableD[index].addEventListener('mouseover', () => {
Array.from(tableD[index].children).forEach(child => {
child.classList.add('highlight');
});
})
tableD[index].addEventListener('mouseout', () => {
Array.from(tableD[index].children).forEach(child => {
child.classList.remove('highlight');
});
})
tableD[index].addEventListener('click', () => {
Array.from(tableD[index].children).forEach(child => {
child.classList.add('highlight-click')
});
})
}
for (let index = 0; index < tablp.length; index++) {
tablp[index].addEventListener('mouseover', () => {
Array.from(tablp[index].children).forEach(child => {
child.classList.add('highlight');
});
})
tablp[index].addEventListener('mouseout', () => {
Array.from(tablp[index].children).forEach(child => {
child.classList.remove('highlight');
});
})
tablp[index].addEventListener('click', () => {
Array.from(tablp[index].children).forEach(child => {
child.classList.add('highlight-click')
});
})
}
for (let index = 0; index < tableD.length; index++){
tableD[index].addEventListener('click',()=>{
id=tableD[index].children[0].innerHTML;
})
}
for (let index = 0; index < tablp.length; index++){
tablp[index].addEventListener('click',()=>{
idp=tablp[index].children[0].innerHTML;
})
}
btaj.addEventListener('click',()=>{
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("jj").innerHTML=id+idp;
}
};
xmlhttp.open("POST", "index.php" , true);
xmlhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xmlhttp.send("p="+id+"?q"+idp);
})