$(function(){ //accordion アコーディオン $('.accordion').click(function(){ if(!$(this).is('.sp_only') || $(this).is('.sp_only') && abi.sp) { var $next = $(this).next(); if(!$next.is(':animated')) $next.slideToggle(300).prev().toggleClass('active'); } }); }); //高さの揃え padding含む function match_outerHeight($o,m,w) { $o.css('height','auto') var foo_length = $o.length, _width = $(window).width(); if (w == null) { w = 0; } if(_width < w) { for(var k = 0; k < foo_length; k++){ $o.eq(k).css('height', 'auto'); } } else { for(var i = 0 ; i < Math.ceil(foo_length / m) ; i++) { var maxHeight = 0; for(var j = 0; j < m; j++){ if ($o.eq(i * m + j).outerHeight() > maxHeight) { maxHeight = $o.eq(i * m + j).outerHeight(); } } for(var k = 0; k < m; k++){ $o.eq(i * m + k).css('height', maxHeight); } } } }