Salut, je voudrais basculer deux divs. Je l'ai fait de manière basique mais je veux vraiment l'écrire de cette façon et je n'ai aucune idée de ce qui ne va pas avec ça. Quelqu'un pourrait-il m'aider avec?Basculer deux divs requête
(function($) {
var showAll = function() {
this.$button = this.find('.btn-all-events');
this.$all = this.find('.all-events');
this.$recent = this.find('.recent-events');
this.initEvents();
};
showAll.prototype = {
initEvents: function() {
if (this.$all) {
this.$button.on('click', this.showEvents.bind(this));
}
},
showEvents: function() {
this.$recent.hide();
this.$all.show();
}
};
this.toggle = new showAll($(this));
})(jQuery);
je remplace ce dans var et ne pas encore fonctionne pour moi –