0
こんにちは、私は2つのdivを切り替えるしたいと思います。私はそれを基本的な方法で作ったが、私は本当にこのように書きたいと思うし、何が間違っているのか分からない。誰かが私にそれを手伝ってもらえますか?2つのdivsクエリを切り替える
(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);
を働いた場合、最大喜ば、それが動作するはずこれを試して、私はVARでこれを交換し、まだ私のためではない作品をして確認することができます –