/** * Created by 10277433 (Michele Martinello) on 26/07/2018. */ $(document).ready(function(){ /*if(getCookie(codeInnovativeTeaching)) { $(".reaction-btn").toggleClass("show"); }*/ /*PAGINAZIONE */ var list = $(".tx-didatticainnovativa .listaCorsi .item"); /* attenzione il valore di numToShow * deve essere uguale a function loadMore($contents, $itemperPage=3, in json_Load_DAti_Didattica_Innovativa.inc */ var numToShow = 9; var button = $("#loadMore"); var numInList = list.length; list.hide(); if(numInList > numToShow){ button.show(); } list.slice(0, numToShow).show(); button.click(function(e){ e.preventDefault(); var showing = list.filter(':visible').length; list.slice(showing - 1, showing + numToShow).fadeIn(); var nowShowing = list.filter(':visible').length; if (nowShowing >= numInList) { button.hide(); } }); /* Accodion Categorie*/ $(function() { var Accordion = function(el, multiple) { this.el = el || {}; this.multiple = multiple || false; // Variables privadas var links = this.el.find('.link'); // Evento links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown) } Accordion.prototype.dropdown = function(e) { var $el = e.data.el; $this = $(this), $next = $this.next(); $next.slideToggle(); $this.parent().toggleClass('open'); if (!e.data.multiple) { $el.find('.submenu').not($next).slideUp().parent().removeClass('open'); }; } var accordion = new Accordion($('.myAccordion'), true); }); });