Skip to content

Instantly share code, notes, and snippets.

@beardlessman
beardlessman / spoiler
Created July 13, 2017 08:54
Spoiler [like jquery-ui accordion(no)]
//js
$('.j-spoiler').each(function(){
new Spoiler(this);
});
Spoiler = function(container) {
this.container = $(container);
this.head = this.container.find('.j-spoiler-head');
this.body = this.container.find('.j-spoiler-body');
this.close = this.container.find('.j-spoiler-close');
this.init();