// JavaScript Document /*ไบบๆ‰ๆ‹›่˜*/ $(function() { var Accordion = function(el, multiple) { this.el = el || {}; this.multiple = multiple || false; var links = this.el.find('.products-tit'); 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('on'); if (!e.data.multiple) { $el.find('.products-xx').not($next).slideUp().parent().removeClass('on'); }; } var accordion = new Accordion($('.sub-products'), false); });