1jQuery(function($) { 2 3 if (!$('.kodate-detail-ideas > div > div').length) { 4 $('.kodate-detail-ideas').hide(); 5 } 6 7 // VIEWPORT 8 const baseW = 1400; 9 const ua = navigator.userAgent 10 11 const sp = ua.indexOf('iPhone') > -1 || 12 (ua.indexOf('Android') > -1 && ua.indexOf('Mobile') > -1) 13 14 const tab = !sp && ( 15 ua.indexOf('iPad') > -1 || 16 (ua.indexOf('Macintosh') > -1 && 'ontouchend' in document) || 17 ua.indexOf('Android') > -1 18 ) 19 20 if (tab) { 21 viewportContent = "width=" + baseW + "px"; 22 document.querySelector("meta[name='viewport']").setAttribute("content", viewportContent); 23 } 24 25 // PAGE 26 if (typeof pbPageEditParams == 'undefined' || pbPageEditParams['statusFlag'] != 1) { 27 } else { 28 $('.pbPage').addClass('edit'); 29 } 30 31 // IMG 32 objectFitImages(); 33 34 // LINK 35 $('a[href^="#"]:not(.c_modal, .k26_detail-movie-modal a)').on('click', function(){ 36 var href = $(this).attr("href"), 37 target = $(href == "#" || href == "" ? 'html' : href), 38 position = target.offset().top; 39 $("html, body").animate({ 40 scrollTop: position 41 }, 500, 'swing'); 42 return false; 43 }); 44 45 // HEADER 46 $('.k_h-header .menu li').each(function() { 47 var href = $(this).find('a').attr('href').replace(/\/\?|\/$|\.html/, ''); 48 if (location.href.match(href)) { 49 $(this).addClass('active'); 50 var index = $(this).parent('ul').find('li').index(this); 51 $('.k_h-global .m-button').removeClass('active').eq(index).addClass('active'); 52 $('.k_h-global .u-content').removeClass('active').eq(index).addClass('active'); 53 } 54 }); 55 56 var scroll_y = 0; 57 $(window).on('scroll', function(){ 58 if($(this).scrollTop() == scroll_y){ 59 $('.k_h-header,.k_h-global').css("left", -$(window).scrollLeft()); 60 } else if ($(this).scrollTop() < scroll_y) { 61 $('.k_h-header').addClass('h-show'); 62 } else if ($(this).scrollTop() > 0) { 63 $('.k_h-header').removeClass('h-show'); 64 } else {} 65 scroll_y = $(this).scrollTop(); 66 if ($(this).scrollTop() > 200) { 67 $('.k_h-header,.k_h-global').addClass('h-black'); 68 } else { 69 $('.k_h-header,.k_h-global').removeClass('h-black'); 70 } 71 }); 72 73 $('.k_h-header .burger-open,.k_h-global .overlay,.k_h-global .burger-close').on('click', function(){ 74 var body = $('body'); 75 if (body.hasClass('open')) { 76 body.removeClass('open').addClass('close'); 77 } else if (body.hasClass('close')){ 78 body.removeClass('close').addClass('open'); 79 } else { 80 body.addClass('open'); 81 } 82 }); 83 84 $('.k_h-global .m-button').on('click', function(){ 85 var index = $(this).index(); 86 $(this).addClass('active').siblings().removeClass('active'); 87 $(this).parents('.k_h-global').find('.u-content').removeClass('active').eq(index).addClass('active'); 88 }); 89 $('.k_h-global .u-content .pull-down').on('click', function(){ 90 $(this).stop(true,true).toggleClass('active'); 91 $(this).next().stop(true,true).slideToggle(); 92 }); 93 94 // SIDE 95 $('.k_side .button').on('click', function(){ 96 $(this).parents('.k_side').toggleClass('close'); 97 }); 98 99 var side = $('.k_side'); 100 side.hide(); 101 $(window).scroll(function () { 102 if ($(this).scrollTop() > 120) { 103 side.fadeIn(); 104 } else { 105 side.fadeOut(); 106 } 107 }); 108 109 // SIDE MODAL 110 $('.c_modal').magnificPopup({ 111 type: 'inline', 112 mainClass: 'mfp-fade', 113 callbacks: { 114 open: function() { 115 $('body').addClass('side-modal modal-header'); 116 bodyScrollPrevent(true); 117 }, 118 close: function(){ 119 $('body').removeClass('side-modal'); 120 bodyScrollPrevent(false); 121 setTimeout(function(){ 122 $('body').removeClass('modal-header'); 123 },100); 124 } 125 } 126 }); 127 function bodyScrollPrevent(flag){ 128 let scrollPosition; 129 const body = document.getElementsByTagName('body')[0]; 130 const ua = window.navigator.userAgent.toLowerCase(); 131 const isiOS = ua.indexOf('iphone') > -1 || ua.indexOf('ipad') > -1 || ua.indexOf('macintosh') > -1 && 'ontouchend' in document; 132 const scrollBarWidth = window.innerWidth - document.body.clientWidth; 133 if(flag){ 134 body.style.paddingRight = scrollBarWidth + 'px'; 135 if(isiOS){ 136 scrollPosition = -window.pageYOffset; 137 body.style.position = 'fixed'; 138 body.style.width = '100%'; 139 body.style.top = scrollPosition + 'px'; 140 } else { 141 body.style.overflow = 'hidden'; 142 } 143 } else if(!flag) { 144 body.style.paddingRight = ''; 145 if(isiOS){ 146 scrollPosition = parseInt(body.style.top.replace(/[^0-9]/g,'')); 147 body.style.position = ''; 148 body.style.width = ''; 149 body.style.top = ''; 150 window.scrollTo(0, scrollPosition); 151 }else { 152 body.style.overflow = ''; 153 } 154 } 155 } 156 157 // SIDE ACCORDION 158 $('.area-box1:not(.active) .box-contens1').hide(); 159 $('.area-box1 .box-title1').on('click', function(){ 160 $(this).stop(true,true).toggleClass('active'); 161 $(this).next('.box-contens1').stop(true,true).slideToggle(); 162 }); 163 164 // FOOTER 165 $('.k_f-pickup .slider').slick({ 166 slidesToShow: 2, 167 dots: true, 168 responsive: [{ 169 breakpoint: 768, 170 settings: {
171 arrows: false, 172 slidesToShow: 1 173 } 174 }] 175 }); 176 177 $('.b-o-footer_pagetop').on('click', function(){ 178 $("html, body").animate({ 179 scrollTop: 0 180 }, 500, 'swing'); 181 return false; 182 }); 183 184 $('.k_f-footer .accordion:not(.active) .a-content').hide(); 185 $('.k_f-footer .a-title').on('click', function(){ 186 $(this).parents('.accordion').stop(true,true).toggleClass('active'); 187 $(this).next('.a-content').stop(true,true).slideToggle(); 188 }); 189 190 $('.k_f-footer .title.pull-down').on('click', function(){ 191 $(this).stop(true,true).toggleClass('active'); 192 $(this).parents('.box').find('.list').stop(true,true).slideToggle(); 193 }); 194 195 // COLUMN 196 $('.k_clm .k_link.f20,.k_clm .k_button').each(function() { 197 $(this).find('a').parents('.box').addClass('link'); 198 }); 199 200 // TILE 201 $('.k_tile .k_link,.k_tile .k_button').each(function() { 202 $(this).find('a').parents('.box').addClass('link'); 203 }); 204 205 // IMAGEBOX 206 $('.k_imagebox .k_link.f20,.k_imagebox .k_link.f22,.k_imagebox .k_link.f28,.k_imagebox .k_button').each(function() { 207 $(this).find('a').parents('.k_imagebox').addClass('link'); 208 }); 209 210 $(window).on('load', function(){ 211 $('.k_imagebox .imagebox.full:not(.auto)').each(function() { 212 var img = $('img',this).height(); 213 $('.k_image',this).height(img); 214 $(this).addClass('active'); 215 }); 216 }); 217 218 // CASE 219 $('.k_case button.favorite').on('click', function(){ 220 $(this).toggleClass('active'); 221 }); 222 223 $('.k_case .case-slider').slick({ 224 slidesToShow: 3, 225 infinite: false, 226 dots: true, 227 responsive: [{ 228 breakpoint: 768, 229 settings: { 230 arrows: false, 231 slidesToShow: 1 232 } 233 }] 234 }); 235 236 $('.k_case .case-tab li').on('click', function(){ 237 $(this).addClass('active').siblings().removeClass('active'); 238 if ($(this).hasClass('in')) { 239 $(this).parents('.k_case').find('.case-column').removeClass('out').addClass('in'); 240 } else { 241 $(this).parents('.k_case').find('.case-column').removeClass('in').addClass('out'); 242 } 243 }); 244 245 // Modal 246 $('.k_modal.video > a,.k_modal.video .modal a').magnificPopup({ 247 type: 'iframe', 248 mainClass: 'mfp-fade' 249 }); 250 $('.detail-link').magnificPopup({ 251 type:'inline', 252 mainClass: 'mfp-fade-inline', 253 removalDelay: 350 254 }); 255 256 // RESULT 257 $('.k_result .search .button').on('click', function(){ 258 $(this).parents('.search').find('.k_ideas').stop(true,true).slideToggle(); 259 }); 260 261 // DETAIL 262 //$('.k_h1.detail .button,.k_favorite .button').on('click', function(){ 263 // $('.k_h1.detail .button,.k_favorite .button').toggleClass('active'); 264 // }); 265 266 // ACCORDION 267 $('.k_accordion:not(.active) .inner').hide(); 268 $('.k_accordion .k_button.more button').on('click', function(){ 269 $(this).parents('.k_accordion').stop(true,true).toggleClass('active'); 270 $(this).parents('.k_accordion').find('.inner').stop(true,true).slideToggle(); 271 }); 272 273 // HEIGHT 274 $('.k_ess .num').matchHeight(); 275 if (typeof pbPageEditParams == 'undefined' || pbPageEditParams['statusFlag'] != 1) { 276 $('.k_clm.col-4 .k_link.f18').matchHeight(); 277 } 278 279 // TAB 280 $('.k_tab .tab li').on('click', function(){ 281 var index = $(this).parent('ul').find('li').index(this); 282 $(this).addClass('active').siblings().removeClass('active'); 283 $(this).parents('.k_tab').find('.k_map').removeClass('active').eq(index).addClass('active'); 284 }); 285 286 // TABLE 287 $('.k_table-swipe').scroll(function() { 288 $(this).addClass('active'); 289 }); 290 291}); 292 293 // HEADER 294 $(window).on('load', function() { 295 if ($(this).scrollTop() == 0) { 296 $('.k_h-header').addClass('h-show'); 297 } 298 }); 299 300 // ANIMATION 301 function animation(){ 302 $('.k_h1,div[class*=k_section],.k_ideas,.k_experience,.k_result').each(function(){ 303 var elemPos = $(this).offset().top+100; 304 var scroll = $(window).scrollTop(); 305 var windowHeight = $(window).height(); 306 if (scroll >= elemPos - windowHeight){ 307 $(this).addClass('animation'); 308 } 309 }); 310 } 311 312 $(window).on('load', function() { 313 animation(); 314 $(window).on('scroll', function(){ 315 animation(); 316 }); 317 318 // ACCORDION 319 function updateItemHeight() { 320 var windowSize = $(window).width(); 321 322 if (windowSize > 768) { 323 $('.k_prefecture-list .trigger.active').each(function() { 324 var itemHeight = $(this).next().outerHeight(); 325 $(this).parents('.item-button').css('margin-bottom', itemHeight); 326 }); 327 } else { 328 $('.k_prefecture-list .trigger.active').each(function() { 329 $(this).parents('.item-button').css('margin-bottom', ''); 330 }); 331 } 332 } 333 334 $('.k_prefecture-list .trigger').click(function() { 335 var windowSize = $(window).width(); 336 var itemHeight = $(this).next().outerHeight(); 337 338 $(this).toggleClass('active'); 339 $('.k_prefecture-list .trigger').not($(this)).removeClass('active'); 340 341 if (windowSize > 768) { 342 if ($(this).hasClass('active')) { 343 $(this).parents('.item-button').css('margin-bottom', itemHeight); 344 $('.k_prefecture-list .trigger').not($(this)).parents('.item-button').css('margin-bottom', ''); 345 } else { 346 $(this).parents('.item-button').css('margin-bottom', ''); 347 } 348 } else { 349 if ($(this).hasClass('active')) { 350 $(this).parents('.item-button').css('margin-bottom', ''); 351 } 352 } 353 354 $(this).next('.link-unit').slideToggle(); 355 $('.k_prefecture-list .trigger').not($(this)).next('.link-unit').slideUp(); 356 }); 357 358 $(window).resize(function() { 359 updateItemHeight(); 360 }); 361 362 updateItemHeight(); 363 364 $(document).ready(function() { 365 var resizeTimer = null; 366 367 handleResize(); 368 369 $(window).resize(function() { 370 if (resizeTimer !== null) { 371 clearTimeout(resizeTimer); 372 } 373 resizeTimer = setTimeout(handleResize, 100); 374 }); 375 376 function handleResize() { 377 var windowWidth = $(window).width(); 378 379 if (windowWidth < 768) { 380 $('.k_prefecture-list .sp-trigger').off('click').on('click', function() { 381 $(this).next('.item').slideToggle(); 382 $(this).toggleClass('active'); 383 }); 384 385 $('.k_prefecture-list .sp-trigger').not('.active').next('.item').slideUp(); 386 } else { 387 $('.k_prefecture-list .sp-trigger').off('click'); 388 $('.k_prefecture-list .item').show().removeAttr('style'); 389 } 390 } 391 }); 392 393});
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.