137 lines
		
	
	
		
			3.4 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			137 lines
		
	
	
		
			3.4 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| $(document).ready(function() {
 | |
|     $("#filtri-tipologia").click(function(){
 | |
|         $(".tipologia-menu").addClass("attivomenu");
 | |
|     });
 | |
| 
 | |
|     $("#back-filtri-tipologia").click(function(){
 | |
|         $(".tipologia-menu").removeClass("attivomenu");
 | |
|     });
 | |
| 
 | |
|     $('#carosellonotizie').owlCarousel({
 | |
|         loop:false,
 | |
|         margin:30,
 | |
|         nav:false,
 | |
|         items:3,
 | |
|         autoplay:false,
 | |
|         autoplayTimeout:5000,/*,
 | |
|         animateOut: 'fadeOut'*/
 | |
|         responsive:{
 | |
|             0:{
 | |
|                 items:1
 | |
|             },
 | |
|             992:{
 | |
|                 items:3
 | |
|             }
 | |
|         }
 | |
|     });
 | |
|     
 | |
|     $('#carosellocircolari').owlCarousel({
 | |
|         loop:false,
 | |
|         margin:30,
 | |
|         nav:false,
 | |
|         items:3,
 | |
|         autoplay:false,
 | |
|         autoplayTimeout:5000,/*,
 | |
|         animateOut: 'fadeOut'*/
 | |
|         responsive:{
 | |
|             0:{
 | |
|                 items:1
 | |
|             },
 | |
|             992:{
 | |
|                 items:3
 | |
|             }
 | |
|         }
 | |
|     });
 | |
| 
 | |
|     $('#caroselloeventi').owlCarousel({
 | |
|         loop:false,
 | |
|         margin:30,
 | |
|         nav:false,
 | |
|         items:3,
 | |
|         autoplay:false,
 | |
|         autoplayTimeout:5000,/*,
 | |
|         animateOut: 'fadeOut'*/
 | |
|         responsive:{
 | |
|             0:{
 | |
|                 items:1
 | |
|             },
 | |
|             992:{
 | |
|                 items:3
 | |
|             }
 | |
|         }
 | |
|     });
 | |
| 
 | |
|     $('#carosello-didattica').owlCarousel({
 | |
|         loop:false,
 | |
|         margin:30,
 | |
|         nav:false,
 | |
|         items:3,
 | |
|         autoplay:false,
 | |
|         autoplayTimeout:5000,/*,
 | |
|         animateOut: 'fadeOut'*/
 | |
|         responsive:{
 | |
|             0:{
 | |
|                 items:1
 | |
|             },
 | |
|             992:{
 | |
|                 items:3
 | |
|             }
 | |
|         }
 | |
|     });
 | |
| 
 | |
|     $('#carosello-documenti').owlCarousel({
 | |
|         loop:false,
 | |
|         margin:30,
 | |
|         nav:false,
 | |
|         items:2,
 | |
|         autoplay:false,
 | |
|         autoplayTimeout:5000,/*,
 | |
|         animateOut: 'fadeOut'*/
 | |
|         responsive:{
 | |
|             0:{
 | |
|                 items:1
 | |
|             },
 | |
|             992:{
 | |
|                 items:2
 | |
|             }
 | |
|         }
 | |
|     });
 | |
| 
 | |
| });
 | |
| 
 | |
| document.addEventListener('DOMContentLoaded', function () {
 | |
|     const linkList = document.querySelector('.link-list');
 | |
| 
 | |
|     linkList.addEventListener('click', function (event) {
 | |
|         event.stopPropagation(); // Previene la chiusura del menu
 | |
|     });
 | |
| });
 | |
| 
 | |
| document.addEventListener('DOMContentLoaded', function () {
 | |
|     // Seleziona tutte le voci di menu che devono comportarsi come toggle
 | |
|     const toggleItems = document.querySelectorAll('.nav-item.dropdown.parent > span');
 | |
| 
 | |
|     toggleItems.forEach(item => {
 | |
|         item.addEventListener('click', function (event) {
 | |
|             // Trova il div che contiene il sottomenu
 | |
|             const submenu = item.nextElementSibling; // Assumendo che il div sia immediatamente dopo lo span
 | |
| 
 | |
|             // Controlla se il sottomenu è visibile
 | |
|             if (submenu.style.display === "block") {
 | |
|                 submenu.style.display = "none"; // Nascondi il sottomenu
 | |
|             } else {
 | |
|                 submenu.style.display = "block"; // Mostra il sottomenu
 | |
|             }
 | |
| 
 | |
|             event.stopPropagation(); // Previene la chiusura del menu principale
 | |
|         });
 | |
|     });
 | |
| 
 | |
|     // Gestisci il clic su un elemento del dropdown per fermare la chiusura
 | |
|     const dropdownItems = document.querySelectorAll('.dropdown-item');
 | |
|     dropdownItems.forEach(item => {
 | |
|         item.addEventListener('click', function (event) {
 | |
|             event.stopPropagation(); // Previene la chiusura del menu
 | |
|         });
 | |
|     });
 | |
| }); |