cannabinieri website
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
3.0 KiB

3 years ago
  1. // this function shows an element by id
  2. function show() {
  3. var x= document.getElementById("information");
  4. if (x.style.display === "none") {
  5. x.style.display = "flex"; }
  6. else {
  7. x.style.display ="none";
  8. }
  9. }
  10. //this function shows element2 by id -to be generalized
  11. function display() {
  12. var x= document.getElementById("footer-links");
  13. if (x.style.display === "none") {
  14. x.style.display = "flex";}
  15. else {
  16. x.style.display ="none";
  17. }
  18. }
  19. function menu() {
  20. var x= document.getElementById("mobile-dropdown");
  21. if (x.style.display === "none") {
  22. x.style.display = "block";}
  23. else {
  24. x.style.display ="none";
  25. }
  26. }
  27. function menu2() {
  28. var x= document.getElementById("down");
  29. if (x.style.display === "none") {
  30. x.style.display = "block";}
  31. else {
  32. x.style.display ="none";
  33. }
  34. }
  35. function menu3() {
  36. var x= document.getElementById("down1");
  37. if (x.style.display === "none") {
  38. x.style.display = "block";}
  39. else {
  40. x.style.display ="none";
  41. }
  42. }
  43. function menu4() {
  44. var x= document.getElementById("down2");
  45. if (x.style.display === "none") {
  46. x.style.display = "block";}
  47. else {
  48. x.style.display ="none";
  49. }
  50. }
  51. function menu5() {
  52. var x= document.getElementById("down3");
  53. if (x.style.display === "none") {
  54. x.style.display = "block";}
  55. else {
  56. x.style.display ="none";
  57. }
  58. }
  59. function menu6() {
  60. var x= document.getElementById("down4");
  61. if (x.style.display === "none") {
  62. x.style.display = "block";}
  63. else {
  64. x.style.display ="none";
  65. }
  66. }
  67. //print pdf file
  68. // const pdfBtn = document.getElementById('print');
  69. // console.log(pdfBtn);
  70. // const printPage = () => {
  71. // window.print();
  72. // }
  73. // pdfBtn.addEventListener("click", (event) => {
  74. // printPage(event, 'printed');
  75. // });
  76. // let screen = () => {
  77. // console.log(window.innerHeight);
  78. // console.log(window.innerWidth);
  79. // };
  80. // screen();
  81. window.addEventListener('load', () => {
  82. document.getElementById('print').addEventListener('click', () => {
  83. let page = this.document.querySelector('.wrapper');
  84. console.log(page);
  85. console.log(window);
  86. })
  87. }, false);