forked from Enricozon-Team/enricozon2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
53 lines (45 loc) · 1.59 KB
/
main.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
function openNav() {
document.getElementById("mySidebar").style.width = "250px";
document.getElementById("mySidebar").style.paddingLeft = "20px";
document.getElementById("mySidebar").style.transition = "0.5s";
document.getElementsByClassName("content")[0].style.marginLeft = "250px";
}
function closeNav() {
document.getElementById("mySidebar").style.width = "0";
document.getElementById("mySidebar").style.paddingLeft = "0";
document.getElementsByClassName("content")[0].style.marginLeft = "0";
}
function showText(text) {
var contentDiv =
document.getElementById("chi-siamo") ||
document.getElementById("coming-soon");
contentDiv.innerHTML = "<p>" + text + "</p>";
}
function filterProducts() {
var input, filter, container, images, description, i, txtValue;
input = document.getElementById("search");
filter = input.value.toUpperCase();
container = document.getElementsByClassName("content")[0];
images = container.getElementsByClassName("image-container");
for (i = 0; i < images.length; i++) {
description = images[i].getElementsByClassName("image-description")[0];
txtValue = description.textContent || description.innerText;
if (txtValue.toUpperCase().indexOf(filter) > -1) {
images[i].style.display = "";
} else {
images[i].style.display = "none";
}
}
}
function playAudio() {
var audio = document.getElementById("audioPlayer");
audio.play();
}
function playAudio2() {
var audio = document.getElementById("audioPlayer2");
audio.play();
}
function playAudio3() {
var audio = document.getElementById("audioPlayer3");
audio.play();
}