-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
39 lines (32 loc) · 1.12 KB
/
script.js
File metadata and controls
39 lines (32 loc) · 1.12 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
/* Toggle between adding and removing the "responsive" class to topnav when the user clicks on the icon */
function myFunction() {
var x = document.getElementById("myTopnav");
if (x.className === "topnav") {
x.className += " responsive";
} else {
x.className = "topnav";
}
}
// Get the carousel container
const carouselContainer = document.querySelector('.carousel-container');
// Clone the first carousel item and append it to the end
const firstItem = carouselContainer.children[0];
carouselContainer.appendChild(firstItem.cloneNode(true));
// Start the animation when the page is loaded
window.onload = function() {
carouselContainer.style.animationPlayState = 'running';
};
/*Print Button Code below
const printButton = document.getElementById('print-button');
const pdfContainer = document.getElementById('pdf-container');
printButton.addEventListener('click', () => {
window.print();
});
function printPDF() {
let originalContents = document.body.innerHTML;
let printContents = pdfContainer.innerHTML;
document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;
}
*/