(function ($, _, util, obj) { $(window).bind("load", function () { if (document.documentElement.clientWidth >= 640) { $("[id^='change_open_status_']").on("click", function () { let isOpen = $(this).attr("is-open") // changeStatus(isOpen, $(this).attr("id")) if (isOpen === 'true') { $('[name=' + $(this).attr("id") + '_content]').css("display", "none") $(this).attr("is-open", "false") $(this).addClass("is-close") } else { $('[name=' + $(this).attr("id") + '_content]').css("display", "block") $(this).attr("is-open", "true") $(this).removeClass("is-close") } }); } }); $(window).bind("load resize", function () { if (document.documentElement.clientWidth >= 640) { fixHeight() } }); /** * 目的から探す * @param {*} flag * @param {*} id */ function changeStatus(flag, id) { if (document.documentElement.clientWidth >= 640) { if (id.indexOf('first') > 0) { $("[id^='change_open_status_first_']").each(function () { if (flag === 'true') { $('[name=' + $(this).attr("id") + '_firstcontent]').css("display", "none") $(this).attr("is-open", "false") $(this).addClass("is-close") } else { $('[name=' + $(this).attr("id") + '_firstcontent]').css("display", "block") $(this).attr("is-open", "true") $(this).removeClass("is-close") } }) } else if (id.indexOf('second') > 0) { $("[id^='change_open_status_second_']").each(function () { if (flag === 'true') { $('[name=' + $(this).attr("id") + '_secondcontent]').css("display", "none") $(this).attr("is-open", "false") $(this).addClass("is-close") } else { $('[name=' + $(this).attr("id") + '_secondcontent]').css("display", "block") $(this).attr("is-open", "true") $(this).removeClass("is-close") } }) } } } function fixHeight() { $("[name='fix_height_first']").each(function () { $(this).addClass('height-auto-important') }) $("[name='fix_height_second']").each(function () { $(this).addClass('height-auto-important') }) let firstMaxHeight = 0; $("[name='fix_height_first']").each(function () { if ($(this).height() > firstMaxHeight) { firstMaxHeight = $(this).height() } }) $("[name='fix_height_first']").each(function () { $(this).height(firstMaxHeight) $(this).removeClass('height-auto-important') }) let secondMaxHeight = 0; $("[name='fix_height_second']").each(function () { if ($(this).height() > secondMaxHeight) { secondMaxHeight = $(this).height() } }) $("[name='fix_height_second']").each(function () { $(this).height(secondMaxHeight) $(this).removeClass('height-auto-important') }) } })(BROTHER.lib.$, BROTHER.lib._, BROTHER.util, BROTHER.obj);