1jQuery(document).ready(function($) { 2 var isMobile = window.matchMedia("(max-width: 1049px)").matches; 3 4 function initAccordion() { 5 $('.topfv_areasubttl').each(function() { 6 if (!$(this).find('.topfv_toggle').length) { 7 $(this).append('<span class="topfv_toggle">+</span>'); 8 } 9 }); 10 11 $('.topfv_areaitem').hide(); 12 13 $('.topfv_areabox').on('click.accordion', function(e) { 14 if (e.target !== this && !$(e.target).hasClass('topfv_areasubttl') && !$(e.target).hasClass('topfv_toggle')) { 15 return; 16 } 17 18 var $this = $(this); 19 var $prefectureList = $this.find('.topfv_areaitem'); 20 var $toggle = $this.find('.topfv_toggle'); 21 22 $('.topfv_areabox').not($this).each(function() { 23 var $other = $(this); 24 if ($other.hasClass('active')) { 25 $other.find('.topfv_areaitem').slideUp(300); 26 $other.removeClass('active'); 27 $other.find('.topfv_toggle').text('+'); 28 } 29 }); 30 31 $prefectureList.slideToggle(300); 32 33 if ($toggle.text() === '+') { 34 $toggle.text('-'); 35 $this.addClass('active'); 36 } else { 37 $toggle.text('+'); 38 $this.removeClass('active'); 39 } 40 }); 41 } 42 43 function destroyAccordion() { 44 $('.topfv_areabox').off('click.accordion'); 45 46 $('.topfv_toggle').remove(); 47 48 $('.topfv_areaitem').show(); 49 50 $('.topfv_areabox').removeClass('active'); 51 } 52 53 if (isMobile) { 54 initAccordion(); 55 } else { 56 destroyAccordion(); 57 } 58 59 $(window).on('resize', function() { 60 var wasMobile = isMobile; 61 isMobile = window.matchMedia("(max-width: 1049px)").matches; 62 63 if (wasMobile !== isMobile) { 64 if (isMobile) { 65 initAccordion(); 66 } else { 67 destroyAccordion(); 68 } 69 } 70 }); 71});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.