User:Cned-PA/common.js

/* Scripts Formation accessibilité numérique */ jQuery(document).ready(function {

var today = new Date; var time = today.getHours; var day = today.getDate; var month = today.getMonth; console.log(day); // readmore var readMoreContent = $(".read-more-content"), readMoreLegend = $(".img-legend"), readMoreButton = $(".btn-read-more"), readLessButton = $(".btn-read-less"), fadeSpeed = 600; if (readMoreContent.length) { readMoreContent.hide; readMoreLegend.hide;

readMoreButton.on("click", function{           $(this).hide;            readMoreContent.fadeIn(fadeSpeed);            readMoreLegend.fadeIn(fadeSpeed);            readLessButton.fadeIn(fadeSpeed);

});

readLessButton.on("click", function{           $(this).hide;            readMoreButton.fadeIn(fadeSpeed);            readMoreContent.fadeOut(fadeSpeed);            readMoreLegend.fadeOut(fadeSpeed);

});

}   // on déploie le contenu au click $('.expandable').on( 'click', function(e) {       var self = $(this);        var next = self.parent.next('.exp-content');        if(self.attr('aria-expanded')==='false'){            self.parent.parent.addClass('open').removeClass('closed');             next.slideDown(500, function { $(this).attr('aria-hidden','false'); });           self.attr('aria-expanded','true');        }        else {             self.parent.parent.addClass('closed').removeClass('open');              next.slideUp(500, function { $(this).attr('aria-hidden','true'); });           self.attr('aria-expanded','false');        }        return false;    }); });