1//"use strict"; 2 3/* ie8,9 load script for ie */ 4function loadScript(url, callback) { 5 var scriptEl = document.createElement('script'); 6 scriptEl.type = 'text/javascript'; 7 scriptEl.onreadystatechange = function () { 8 callback && callback(); 9 }; 10 scriptEl.src = url; 11 document.getElementsByTagName('head')[0].appendChild(scriptEl); 12} 13 14/*function*/ 15/*responsive image*/ 16var responsiveImage = function(){ 17 var that = { 18 breakName : (function(){ 19 return setting.mobile ? [720] : [1024,1600] 20 })(), 21 oldWideMode : null, 22 thisWideMode : null, 23 intervalChk : null, 24 changeChk : null, 25 imgs : $('img.responsive'), 26 change : function(){ 27 var $t = this, chkMode = -1; 28 29 //find current Mode 30 do { ++chkMode } while(window.innerWidth > $t.breakName[chkMode]); 31 chkMode = Math.min(chkMode, $t.breakName.length-1); 32 33 //Change current Mode 34 $t.thisWideMode = $t.breakName[chkMode]; 35 36 if($t.oldWideMode != $t.thisWideMode){ 37 $t.imgs = $('img.responsive'); 38 39 $t.imgs.each(function(){ 40 var thisImgSrc = this.src; 41 this.src = thisImgSrc.replace( /((_\.)|(_+\d+\.))/i, '_' + $t.thisWideMode + '.'); 42 }); 43 $t.oldWideMode = $t.thisWideMode; 44 } 45 46 }, 47 init : function(){ 48 var $t = this; 49 50 $t.change(); 51 52 $(window).on('resize',function(){ 53 //Throttle 54 clearTimeout($t.intervalChk); 55 $t.intervalChk = setTimeout(function(){ 56 $t.change(); 57 },200); 58 }); 59 } 60 } 61 return that; 62} 63 64 65/*loading*/ 66var loading = (function(){ 67 var that = { 68 show : function(){ 69 if($('.loader-wrap').length < 1) 70 $('<div class="loader-wrap"><div class="loader-box"><img src="/kr/business/asset/images/common/lgloader.gif"></div></div>').appendTo('body'); 71 }, 72 hide : function(){$('.loader-wrap').remove()} 73 } 74 return that; 75})() 76 77/*gnb2b*/ 78var gnb2b = (function(chk) { 79 var that = { 80 web : function(n) { 81 $('.gnb-list .search > .search-container').css("display","none"); 82 $('.gnb-list .search > a').on('click', function(e){ 83 e.preventDefault(); 84 $('.gnb-list .search > .search-container').css("display","block"); 85 $(".gnb-main-container .search-container fieldset").css("left","20%"); 86 $('.search-word > input').focus(); 87 }); 88 89 $('.search-container .inner .btn-close').on('click', function(e){ 90 e.preventDefault(); 91 $('.gnb-list .search > .search-container').css("display","none"); 92 $('.gnb-list .search-focus').focus(); 93 }).keydown(function (event) { 94 if (event.keyCode === 13) { 95 $('.gnb-list .search > .search-container').css("display","none"); 96 $('.gnb-list .search-focus').focus(); 97 } 98 }); 99 100 101 $('#headerWrap .gnb-list > li:not(.search,.recent,.business)').on({ 102 "mouseenter focusin" : function() { 103 $(('~ .gnb-depth-container'),$('>a', this).addClass("selected")).show().stop().animate({maxHeight : 650}, 500); 104 }, 105 "mouseleave focusout" : function() { 106 $(('~ .gnb-depth-container'),$('>a', this).removeClass("selected")).stop().animate({ maxHeight : 0 }, 200, function() { this.style.display = "none" }); 107 } 108 }); 109 /* skip navigation */ 110 //[BTOCSITE-111533]1 ì ë ¥ì¥ì¹ ì ê·¼ì± 11.ì´ì ì´ëê³¼ íì ìì 111 //$("#skip_nav").attr("tabindex", 0).focus(); 112 $("#skip_nav").focus(); 113 $("#skip_nav a[href^='#']").click(function(evt) { 114 var anchortarget = $(this).attr("href"); 115 if (anchortarget != "#") { 116 $(anchortarget).length ? $(anchortarget).attr("tabindex", 0).focus() : $('#container').length ? $('#container').attr("tabindex", 0).focus() : $('#ifrContent').attr("tabindex", 0).focus(); 117 } 118 }); 119 120 $("#skip_nav a") 121 .focus(function() { 122 $("#skip_nav a").removeClass("on").filter(this).addClass("on"); 123 }) 124 .blur(function() { 125 $("#skip_nav a").removeClass("on"); 126 }) 127 128 /*pad*/ 129 if ($('html').hasClass('pad')) { 130 $('#headerWrap .gnb-list > li:not(.search,.recent)').on({ 131 "click" : function() { 132 var thisBtn = $(this); 133 if (thisBtn.hasClass('padClk')) { 134 135 } else { 136 thisBtn.addClass('padClk'); 137 return false; 138 } 139 140 }, 141 "touchstart" : function() { 142 $(('~ .gnb-depth-container'), 143 $('>a', this).addClass("selected")) 144 .show().stop().animate({ 145 maxHeight : 350 146 }, 500); 147 148 }, 149 "mouseleave" : function() { 150 $(('~ .gnb-depth-container'), 151 $('>a', this).removeClass("selected")) 152 .stop().animate({ 153 maxHeight : 0 154 }, 200, function() { 155 this.style.display = "none" 156 });
157 } 158 }, '>a'); 159 } 160 161 }, 162 mobile : function(n) { 163 //console.log('mobile gnb2b!') 164 var gnbobjs = $('.gnb-main'), mbg = $('.mbg'), gnbList = $('.gnb-list'), mBtnGnb = $('#headerWrap .menu'), btnClose = $('.gnb-main-container .btn-close'), contentArea = $('#headerWrap, #contentWrap, #footerWrap'); 165 var $mobileNavHideTargets = $('.logo, .mobile-shortcut, #content, #footerWrap, .move-top'); 166 btnClose.hide(); 167 168 function syncGnbBtnMoreA11y($btn) { 169 var collapsed = $btn.attr('data-collapsed') || $btn.attr('data-a11y-collapsed'); 170 var expandedTxt = $btn.attr('data-expanded') || $btn.attr('data-a11y-expanded'); 171 if (!collapsed || !expandedTxt) return; 172 var open = $btn.attr('aria-expanded') === 'true'; 173 $btn.attr('aria-label', open ? expandedTxt : collapsed); 174 var $blind = $btn.find('.blind'); 175 if ($blind.length) $blind.text(open ? expandedTxt : collapsed); 176 } 177 178 //ê°ì ë²í¼ íê·¸ ìì . 179 gnbobjs.find('.gnb-depth3 > li > .unit').each(function(){ 180 var $t = $(this); 181 if($t.children('ul').length > 0) { 182 if($t.children('button').length < 1) { 183 $t.append('<button type="button" class="btn-more icon onM" aria-expanded="false" aria-label="ì¸ë¶ ë©ë´ í¼ì¹ê¸°" data-collapsed="ì¸ë¶ ë©ë´ í¼ì¹ê¸°" data-expanded="ì¸ë¶ ë©ë´ ì 기"><span class="blind">ì¸ë¶ ë©ë´ í¼ì¹ê¸°</span></button>'); 184 } else { 185 $t.children('button.btn-more').attr('aria-expanded', 'false'); 186 syncGnbBtnMoreA11y($t.children('button.btn-more')); 187 } 188 } else { 189 $t.children('button').remove() 190 } 191 }); 192 193 $(document).on({ 194 "click" : function(e) { 195 // hide search 196 if(document.getElementById('AKCDivTop')) 197 document.getElementById('AKCDivTop').style.display = "none"; 198 199 if ($(this).hasClass('menu')) { 200 document.body.style.overflow = "hidden"; 201 $mobileNavHideTargets.attr('aria-hidden', 'true'); 202 gnbobjs.css({ 203 "display" : "block", 204 "right" : 0, 205 "left" : 0 206 //"left" : "15.278%" 207 },function() { 208 document.body.style.overflow = "hidden"; 209 }).addClass('on'); 210 mbg.css({ 211 "right" : 0, 212 "opacity" : 0.7 213 }); 214 gnbList.attr({"tabIndex" : 0}).focus(); 215 mBtnGnb.attr({"tabIndex" : -1}); 216 217 btnClose.show().animate({ "opacity" : 1 }); 218 } else { 219 $(this).removeClass('on'); 220 contentArea.removeClass('mgnbOn'); 221 $mobileNavHideTargets.attr('aria-hidden', 'false'); 222 gnbobjs.css({ 223 "display" : "none", 224 "right" : "-100%", 225 "left" : "100%" 226 }).removeClass('on'); 227 228 document.body.style.overflow = "visible"; 229 mbg.css({ 230 "right" : "-100%", 231 "opacity" : 0.4 232 }); 233 gnbList.attr({"tabIndex" : -1}); 234 mBtnGnb.attr({"tabIndex" : 0}).focus(); 235 btnClose.animate({"opacity" : 0}, function(){ $(this).hide() }); 236 }; 237 } 238 },'.gnb-main-container a, .gnb-main-container button.btn-close'); 239 240 function gnbBtnMoreNextPanel($btn) { 241 return $btn.next('.gnb-depth-container, ul.gnb-depth3, ul.gnb-depth4'); 242 } 243 244 $(document).off('click.gnbBtnMore', '.gnb-list button.btn-more').on('click.gnbBtnMore', '.gnb-list button.btn-more', function(e) { 245 e.preventDefault(); 246 var $btn = $(this); 247 var thisBtnP = $btn.prev(); 248 var $panel = gnbBtnMoreNextPanel($btn); 249 $btn.closest('ul').find('li > ul').hide(); 250 $btn.closest('ul').find('button.btn-more').attr('aria-expanded', 'false').each(function () { 251 syncGnbBtnMoreA11y($(this)); 252 }); 253 if (thisBtnP.hasClass('selected')) { 254 thisBtnP.removeClass('selected'); 255 $btn.attr('aria-expanded', 'false'); 256 $panel.hide(); 257 } else { 258 thisBtnP.addClass('selected'); 259 if ($panel.length) { 260 $panel.show(); 261 } 262 $btn.attr('aria-expanded', 'true'); 263 } 264 syncGnbBtnMoreA11y($btn); 265 }); 266 } 267 }; 268 return chk ? that.mobile : that.web; 269})(setting.mobile); 270 271/*layer popup*/ 272var popup = { 273 hiddenBgSelectors: '#headerWrap, #skip_nav, #content, #footerWrap, .online_banner_link, .move-top', 274 openCount: 0,
275 setBackgroundAriaHidden: function(isHidden) { 276 var value = isHidden ? 'true' : null; 277 $(this.hiddenBgSelectors).each(function() { 278 if (isHidden) { 279 $(this).attr('aria-hidden', value); 280 } else { 281 $(this).removeAttr('aria-hidden'); 282 } 283 }); 284 }, 285 markPopupOpened: function() { 286 this.openCount += 1; 287 if (this.openCount === 1) { 288 this.setBackgroundAriaHidden(true); 289 } 290 }, 291 markPopupClosed: function() { 292 if (this.openCount > 0) { 293 this.openCount -= 1; 294 } 295 if (this.openCount === 0) { 296 this.setBackgroundAriaHidden(false); 297 } 298 }, 299 open: function(opt) { 300 this.lastFocusedEl = document.activeElement; 301 var popTgt = $('<div/>').attr('class', 'pop').appendTo(document.body); 302 303 popTgt.attr({ 304 'role': 'dialog', 305 'aria-modal': 'true' 306 }); 307 308 if (opt.sourceId != null && document.querySelector(opt.sourceId)) { 309 $(opt.targetId).find('.popupInfo').html(document.querySelector(opt.sourceId).outerHTML); 310 } 311 312 //hide move-top 313 $('.move-top').addClass('force'); 314 315 // create background 316 if (popTgt.children('.pop-bg').length < 1) { 317 popTgt.append($('<div/>').addClass('pop-bg')); 318 } 319 this.markPopupOpened(); 320 321 setTimeout(function() { 322 var $popupContent = $(opt.targetId).show().appendTo(popTgt).attr("tabindex", "0") 323 .css({ 324 "top": $(window).scrollTop() + Math.max(($(window).height() - $(opt.targetId).height()) / 2, 30) + "px", 325 "left": "50%", 326 "margin-left": -($(opt.targetId).width() / 2) + "px" 327 }).off().on({ 328 "click": function() { 329 popup.close(this) 330 } 331 }, '.close').focus(); 332 333 var focusableElements = $popupContent.find('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'); 334 var firstElement = focusableElements.first(); 335 var lastElement = focusableElements.last(); 336 337 $popupContent.on('keydown', function(e) { 338 if (e.key === 'Escape') { 339 popup.close(this); 340 return; 341 } 342 343 if (e.key === 'Tab') { 344 if (e.shiftKey) { // Shift + Tab 345 if (document.activeElement === firstElement[0]) { 346 e.preventDefault(); 347 lastElement.focus(); 348 } 349 } else { // Tab 350 if (document.activeElement === lastElement[0]) { 351 e.preventDefault(); 352 firstElement.focus(); 353 } 354 } 355 } 356 }); 357 358 if (typeof opt.callback === "function") { 359 opt.callback.call(document.querySelector(opt.targetId)); 360 } 361 }, 500); 362 }, 363 364 openURL: function(opt) { 365 this.lastFocusedEl = document.activeElement; 366 var popTgt = $(document.createElement('div')).attr('class', 'pop openURL') 367 .attr({ 368 'role': 'dialog',
369 'aria-modal': 'true' 370 }) 371 .show().appendTo(document.body); 372 373 //hide move-top 374 $('.move-top').addClass('force'); 375 376 // create background 377 if (popTgt.children('.pop-bg').length < 1) { 378 popTgt.append($('<div/>').addClass('pop-bg')); 379 } 380 this.markPopupOpened(); 381 382 popTgt.load(opt.url + ' ' + opt.targetId, function() { 383 var popTgtCont = popTgt.find(opt.targetId).show(); 384 385 popTgtCont.css({ 386 "top": $(window).scrollTop() + 30 + "px", 387 "left": "50%", 388 "margin-left": -(popTgtCont.width() / 2) + "px" 389 }).off().on({ 390 "click": function() { 391 popup.close(this) 392 } 393 }, '.close, #cancel').attr("tabindex", "1").focus(); 394 395 var focusableElements = popTgtCont.find('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'); 396 var firstElement = focusableElements.first(); 397 var lastElement = focusableElements.last(); 398 399 popTgtCont.on('keydown', function(e) { 400 if (e.key === 'Escape') { 401 popup.close(this); 402 return; 403 } 404 405 if (e.key === 'Tab') { 406 if (e.shiftKey) { // Shift + Tab 407 if (document.activeElement === firstElement[0]) { 408 e.preventDefault(); 409 lastElement.focus(); 410 } 411 } else { // Tab 412 if (document.activeElement === lastElement[0]) { 413 e.preventDefault(); 414 firstElement.focus(); 415 } 416 } 417 } 418 }); 419 }); 420 }, 421 422 msg: function(opt) { 423 this.lastFocusedEl = document.activeElement; 424 var popTgt = $('<div/>').attr('class', 'pop openURL') 425 .attr({ 426 'role': 'dialog',
427 'aria-modal': 'true' 428 }) 429 .show().appendTo(document.body); 430 this.markPopupOpened(); 431 432 popTgt.load( 433 '/kr/business/common/common/common-popups-html.do #popup_form', 434 function() { 435 var popTgtCont = popTgt.find('.popup').show(); 436 437 if (opt.title) { 438 popTgtCont.find('.poptit').html(opt.title) 439 }; 440 popTgtCont.find('.popupInfo').html(opt.msg); 441 442 if (opt.confirm) { 443 popTgtCont.find('.btns #ok').show() 444 }; 445 popTgtCont.on({ 446 "click": function() { 447 var thisBtn = $(this), 448 thisType = thisBtn.attr('id'); 449 switch (thisType) { 450 case 'ok': // ok 451 if (opt.confirmTrue) { 452 opt.confirmTrue(); 453 } 454 popup.close(this); 455 break; 456 case 'cancel': // cancel 457 case 'close': // close 458 default: 459 if (opt.confirmFalse) { 460 opt.confirmFalse(); 461 } 462 popup.close(this); 463 } 464 } 465 }, '.close, button, a'); 466 467 popTgtCont.css({ 468 "top": $(window).scrollTop() + Math.max(($(window).height() - popTgtCont.height()) / 2, 30) + "px", 469 "left": "50%", 470 "margin-left": -(popTgtCont.width() / 2) + "px" 471 }); 472 473 var focusableElements = popTgtCont.find('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'); 474 var firstElement = focusableElements.first(); 475 var lastElement = focusableElements.last(); 476 477 popTgtCont.on('keydown', function(e) { 478 if (e.key === 'Escape') { 479 popup.close(this); 480 return; 481 } 482 483 if (e.key === 'Tab') { 484 if (e.shiftKey) { // Shift + Tab 485 if (document.activeElement === firstElement[0]) { 486 e.preventDefault(); 487 lastElement.focus(); 488 } 489 } else { // Tab 490 if (document.activeElement === lastElement[0]) { 491 e.preventDefault(); 492 firstElement.focus(); 493 } 494 } 495 } 496 }); 497 498 firstElement.focus(); 499 } 500 ); 501 }, 502 503 close: function(n) { 504 var closeTgt = $(n).closest('.pop'); 505 var $dmRequest = closeTgt.find('#dmRequest'); 506 507 if (closeTgt.hasClass('openURL')) { 508 closeTgt.remove(); 509 } else { 510 closeTgt.children('.pop-bg').remove(); 511 if ($dmRequest.length) { 512 closeTgt.hide(); 513 } else { 514 closeTgt.find('.popup').unwrap().hide(); 515 } 516 $('.move-top').removeClass('force'); 517 } 518 519 if (this.lastFocusedEl) { 520 $(this.lastFocusedEl).focus(); 521 } 522 this.markPopupClosed(); 523 } 524}; 525/* toggle */ 526var toggle = (function(chk) { 527 // tg-btn 기ì¤ì¼ë¡ í ê¸ ëì(tg-cont)ì ì°¾ëë¤. 528 // - 기본: ë²í¼ ë¤ì íì ë¤ ì¤ ì²« tg-cont (ì¤ê°ì ë¤ë¥¸ ììê° ìì´ë OK) 529 // - ìì¸: ë²í¼ì ë¶ëª¨ ë¤ì íì ë¤ ì¤ ì²« tg-cont (기존 ë§í¬ì í¸í) 530 var getTgCont = function($btn){ 531 if(!$btn || !$btn.length) return $(); 532 var $c = $btn.nextAll('.tg-cont').first(); 533 if($c.length) return $c; 534 return $btn.parent().nextAll('.tg-cont').first(); 535 }; 536 // ì ê·¼ì±: aria-expandedë ì¤ì í ê¸ ì»¨í¸ë¡¤(ë²í¼)ì ë¶ì¬ëì´ì¼ í¨. 537 // - ìì¸(#divSearchArea): tg-btnì´ sectionì´ê³ ë´ë¶ buttonì´ í´ë¦ 컨í¸ë¡¤ì´ë¯ë¡ buttonì aria-expanded í ê¸ 538 var getA11yToggleEl = function($tgBtn){ 539 if(!$tgBtn || !$tgBtn.length) return $(); 540 if($tgBtn.is('button')) return $tgBtn; 541 if($tgBtn.closest('#divSearchArea').length){ 542 var $b = $tgBtn.find('button').first(); 543 if($b.length) return $b; 544 } 545 return $tgBtn; 546 }; 547 var setA11yExpanded = function($tgBtn, expanded){ 548 $tgBtn.each(function(){ 549 var $el = $(this); 550 var $a11y = getA11yToggleEl($el);
551 if ($el.is('a.tg-btn') && $el.find('span.category-icon.onM').length) { 552 $a11y.removeAttr('aria-expanded'); 553 return; 554 } 555 var val = expanded ? 'true' : 'false'; 556 $a11y.attr('aria-expanded', val); 557 }); 558 }; 559 var that = { 560 web : function(n) { 561 $('.tg-slide').not('.tgM').off().on({'click' : tgClick}, '.tg-btn') 562 .find('.tg-cont').hide().end().find('.tg-btn.on').each(function() { 563 setA11yExpanded($(this), true); 564 getTgCont($(this)).show(); 565 }) 566 .end().find('.tg-slide-inner .tg-cont').show(); // only web(tv ad); 567 $('.tg-slide').find('.tg-cont .slide-module-b27 a').each(function(){ 568 if(!this.getAttribute('title')){ 569 this.setAttribute('title', 'íì´ì§ë¡ ì´ë'); 570 } 571 }); 572 }, 573 mobile : function(n) { 574 $('.tg-slide').not('.tgW').off().on({'click' : tgClick}, '.tg-btn:not(".link")') 575 .find('.tg-cont').hide() 576 .end().find('.tg-btn.on').each(function() { 577 setA11yExpanded($(this), true); 578 getTgCont($(this)).show(); 579 }); 580 581 $('.tg-btn').each(function(){ 582 var $t = $(this); 583 var $cont = getTgCont($t); 584 if($("meta[name='description']").attr('content').indexOf('ì루ì ') > 0){ 585 if($cont.length && $cont.children().length < 1){ 586 $t.addClass('link'); 587 $cont.remove(); 588 } 589 } 590 591 if($(this).closest('.module-b31').length > 1) { 592 593 if( $(this).next('.tg-cont').children().length < 1 ) { 594 $(this).next('.tg-cont').remove(); 595 } 596 if( $(this.parentNode).next('.tg-cont').children().length < 1 ) { 597 $(this.parentNode).next('.tg-cont').remove(); 598 } 599 600 } 601 // ì¤ê°ì windows-logo-area ë±ì´ ìì´ë tg-contê° ì¡´ì¬íë©´ link ì²ë¦¬íì§ ìì 602 !getTgCont($t).length && $t.addClass('link'); 603 604 if(!$(this).hasClass('prev-ad')) { 605 var $cText = getTgCont($t); 606 if($cText.length && ($cText.find('li.selected').length || $cText.find('li.on').length)){ 607 $t.text( $cText.find('li.selected a, li.on:first a').text().split('[')[0] ) 608 }; 609 } 610 611 }) 612 613 // ì ê·¼ì±: 모ë°ì¼ìì ì í ìì¸ íì´ì§ë¡ ì´ëíë ë§í¬ì title ì¶ê°(기존 titleì´ ìì¼ë©´ ì ì§) 614 $('.tg-slide').not('.tgW').find('.tg-cont .slide-module-b27 a').each(function(){ 615 if(!this.getAttribute('title')){ 616 this.setAttribute('title', 'íì´ì§ë¡ ì´ë'); 617 } 618 }); 619 620 } 621 }, tgClick = function(e) { 622 e.preventDefault(); 623 var tgBtn = $(this), 624 tgCont = getTgCont(tgBtn), 625 tgClose = function(btn, cont) { 626 btn.removeClass('on'); 627 cont.slideUp(200); 628 setA11yExpanded(btn, false); 629 }, 630 tgOpen = function(btn, cont) { 631 btn.addClass('on'); 632 cont.slideDown(300); 633 setA11yExpanded(btn, true); 634 }; 635 636 if (tgBtn.hasClass('on')) { 637 tgClose(tgBtn, tgCont); 638 } else { 639 var accord = tgBtn.parents('.tg-slide.tg-accord'); 640 if (accord.length) // add accordion function 641 tgClose(accord.find('.tg-btn').not(tgBtn), accord.find('.tg-cont').not(tgCont)); 642 tgOpen(tgBtn, tgCont); 643 } 644 } 645 return (chk) ? that.mobile : that.web; 646})(Modernizr.touch); 647 648/* common tab */ 649var commonTab = (function(chk) { 650 var that = { 651 web : function(n) { 652 var tab = $('.common-tab'); 653 $('a', tab).each(function(index) { 654 /* try{ 655 this.title = $(this).text().trim(); 656 }catch(e){ 657 this.title = 'ì íë¨'; 658 };*/ 659 660 if ($(this).hasClass("selected")) { 661 $(this).attr('title', 'ì íë¨'); 662 $(this).closest('li:not(.sub-common-tab > li)').find('>a').html($(this).text()); 663 } 664 }); 665 666 tab.on({ 667 "mouseenter focusin" : function() { 668 $(this).closest('li').siblings().find('ul').stop().slideUp(300); 669 $(this).addClass('on').closest('li').find('ul').stop().slideDown(300); 670 if($(this).hasClass('more')){ 671 $(this).attr('aria-expanded', 'true'); 672 } 673 } 674 }, 'li>a') 675 .on({ 676 "mouseleave" : function() { 677 $(this).find('ul').stop().slideUp(300); 678 $(this).find('a').removeClass('on'); 679 $(this).find('a.more').attr('aria-expanded', 'false'); 680 } 681 }, 'li') 682 .on({ 683 "click" : function() { 684 $('a', tab).each(function() { 685 $(this).removeAttr('title'); 686 }); 687 688 $(this).attr('title', 'ì íë¨'); 689 if($(this).attr("href") == '#none' && $(this).next().hasClass("sub-common-tab")){ 690 location.href = $(this).next().find('a').eq(0).attr("href"); 691 } else { 692 $('a', tab).each(function() { 693 /*$(this).text(this.title);*/ 694 }); 695 $(this).closest('li:not(.sub-common-tab > li)').find('>a').html($(this).text()); 696 } 697 } 698 }, 'a'); 699 }, 700 mobile : function(n) { 701 var tab = $('.common-tab'); 702 $('a', tab).each(function(index) { 703 //this.title = this.innerHTML; 704 705 if ($(this).hasClass("selected")) { 706 $(this).attr('title', 'ì íë¨'); 707 $(this).closest('li:not(.sub-common-tab > li)').find('>a').html(this.innerHTML); 708 } 709 }); 710 711 tab.on({ 712 "mouseleave" : function() { 713 $(this).find('>a').removeClass("no"); 714 $(this).find('ul').stop().slideUp(300); 715 } 716 }, 'li') 717 .on({ 718 "click" : function() { 719 (!$(this).is('.no')) ? $(this).attr('aria-expanded', 'true').addClass("no").closest('li').find('ul').stop().slideDown(300) : $(this).attr('aria-expanded', 'false').removeClass("no").closest('li').find('ul').stop().slideUp(300); 720 } 721 }, 'a'); 722 } 723 }; 724 return chk ? that.mobile : that.web; 725})(setting.mobile); 726 727/* ie8 seletbox fnc */ 728var ie8selectbox = function(){ 729 $('body') 730 .on({ 731 'click' : function(e){
732 var $t=$(this), $ipt=$t.prev('input'), type=$ipt[0].type; 733 if(type != 'radio' && $t[0].type != 'input'){ 734 e.preventDefault(); 735 if($t.prev('input').is(':checked')){$t.removeClass('checkbox-checked')}else{$t.addClass('checkbox-checked')}; 736 $ipt.trigger('click'); 737 ie8selectbox.repaintBugFix(); 738 } 739 } 740 },'label') 741 .on({ 742 'change' : function(e){ 743 var $t=$(this), $label=$t.next('label'); 744 $label.addClass('radio-checked').parent().siblings().find('label').removeClass('radio-checked'); 745 ie8selectbox.repaintBugFix(); 746 } 747 },"input[type='radio']"); 748} 749ie8selectbox.repaintBugFix = function(){ 750 var tempH = $(window).scrollTop(); 751 $('body').hide(); 752 $('body').show(); 753 $(window).scrollTop(tempH) 754} 755 756/* playmovie */ 757var onYouTubeIframeAPIReady, ytPlayer; 758function playmovie(n,type) { 759 if (!setting.mobile) { 760 lastFocusedEl = document.activeElement; 761 762 var iframe = $(document.createElement('iframe')).attr({ 763 'src': 'https://www.youtube.com/embed/' + n + '?rel=0&autoplay=1', 764 'frameborder': 0 765 }); 766 767 // event.target.id = "backFocus"; 768 var movieHtml = $("<div class='movieCont'/>") 769 .append(iframe) 770 .append("<a class='icon rd-close' href='#backFocus' title='close popup'></a>") 771 .off('click').on('click', 'a', function() { 772 $('#movie').hide().remove(); 773 if(lastFocusedEl) { 774 $(lastFocusedEl).focus(); 775 } 776 return false; 777 }); 778 779 iframe.on('load', function () { 780 movieHtml.find('.scriptContent').remove(); 781 782 var scriptContent = $(".script-area #" + n).html(); 783 784 if (scriptContent) { 785 movieHtml.addClass('useScript'); 786 var scriptArea = $("<div class='scriptContent'/>") 787 .append("<div class='script-content' style='display: none;' tabindex='0'>" + scriptContent + "</div>") 788 .append("<button class='subtitle-button'>ëìì ì¤ëª 보기</button>"); 789 790 scriptArea.find('.subtitle-button').click(function () { 791 var scriptContent = $(this).siblings('.script-content'); 792 if (scriptContent.css('display') === 'none') { 793 scriptContent.css('display', 'block').focus(); 794 $(this).addClass('on'); 795 } else { 796 scriptContent.css('display', 'none'); 797 $(this).removeClass('on'); 798 } 799 }).keydown(function (event) { 800 if (event.keyCode === 9) { 801 movieHtml.focus(); 802 } 803 }); 804 805 movieHtml.append(scriptArea); 806 } 807 }); 808 var movTgt = $(document.createElement('div')).attr('id', 'movie').css('height',$(window).height()).append($(document.createElement('div')).addClass('pop-bg')).show().append(movieHtml).appendTo($('body')); 809 movieHtml.attr('tabindex', '0').focus(); 810 if(type == 'fridge') { movTgt.addClass('fridge') } 811 812 if($('#movie .pop-bg').height() > screen.height + 500){ 813 //bestmall 814 $('.movieCont').height(screen.height-300).css('top','1000px') 815 } 816 817 } else { 818 window.open('https://m.youtube.com/watch?v=' + n); 819 } 820}; 821 822var actJScrollPane = function() { 823 if(setting.web && document.querySelector(".jscroll")) { 824 if(jQuery().jScrollPane) { 825 $(".jscroll").jScrollPane({ autoReinitialise : true }); 826 } else { 827 console.log('jScroll íë¬ê·¸ì¸ì´ íìí©ëë¤.'); 828 } 829 } 830}; 831 832var uspInit = function() { 833 sliderBx(); 834 moduleInit(); 835 836 /*temp*/ 837 setTimeout(function(){ 838 moduleInit(); 839 $(document).trigger('resize'); // bxslider reload 840 },700); 841}; 842 843var moduleInit = function(){ 844 var tgtDiv = $('#ftVcArea, #replaceBox'); 845 tgtDiv.find('img').each(function(){ 846 try{ 847 var thisImg = $(this); 848 var image = new Image(); 849 image.onerror = function(){thisImg.remove()}; 850 image.src = thisImg.attr('src'); 851 }catch(e){ 852 } 853 /*var thisImg = $(this); 854 var image = new Image(); 855 image.onerror = function(){thisImg.remove()}; 856 image.src = thisImg.attr('src');*/ 857 }); 858 859 tgtDiv.find('div:visible .background-image').each(function(){ 860 var $t = $(this); 861 !$t.find('img:visible').length && $t.remove(); 862 }); 863 864 tgtDiv.on('click','.layout-5 .subDetail, .module-b23 .subDetail',function(){$(this).toggleClass('on')}); 865 866 //responsiveImage 867 responsiveImage().init(); 868 869 870}; 871 872var sliderBx = function() { 873 874 /* type01, type02 */ 875 $(".slideUl").each(function() { 876 var $t = $(this); 877 878 // front, mobile separate 879 if( $t.hasClass((setting.mobile ? 'onW' : 'onM')) ) { 880 return false; 881 } 882 883 //ì¬ë¼ì´ë ì¤ë³µëì ë°©ì§ 884 if( $t.parent('.bx-viewport').length ) { 885 return false; 886 } 887 888 // children li remove at front, mobile 889 $t.find(setting.mobile ? '.onW' : '.onM').remove(); 890 891 if(jQuery().bxSlider) { 892 if($t.children('li').length > 1) { 893 var opt = { 894 auto : (!setting.mobile) && ($t.hasClass('auto') || $t.find('.banner-1, .cmcr-info').length) || $t.parent().is('.hero-products'), 895 autoControls : (!setting.mobile) && $t.parent().is('.hero-products'), 896 autoHover : true, 897 nextSelector : $(('.next'), $t.parent()), 898 prevSelector : $(('.prev'), $t.parent()), 899 nextText : 'ë¤ì ì¬ë¼ì´ë ì´ë', 900 prevText : 'ì´ì ì¬ë¼ì´ë ì´ë', 901 speed : 600, 902 autoStart: true, 903 onSliderLoad: function(currentIndex) { 904 //$t.attr('aria-live','polite') //BTOCSITE-112062 3.2 ì측 ê°ë¥ì± 26.ì¬ì©ì ì구ì ë°ë¥¸ ì¤í ê´ë ¨ ìì 905 var $pager = $t.closest('.bx-wrapper').find('.bx-pager'); 906 $pager.find('a').each(function(index){ 907 $(this).html('<span class="blind">' + (index + 1) + 'ë² ì¬ë¼ì´ë 보기</span>'); 908 $(this).attr('href', '#'); 909 });
910 $pager.find('a').on('click', function(e){ 911 e.preventDefault(); 912 }); 913 914 // 모ë°ì¼ hero-productsë ì´ê¸° ë¡ë© ì aria-currentê° ëë½ë ì ìì´ currentIndex 기ì¤ì¼ë¡ 먼ì ì¸í 915 // NOTE: hero-productsë <section> ëë ë´ë¶ <li class="... hero-products"> ë± ë¤ìí êµ¬ì¡°ê° ìì´ closestë¡ íë³ 916 if($t.closest('.hero-products').length){ 917 var initIdx = (typeof currentIndex === 'number') ? currentIndex : 0; 918 $pager.find('a').attr('aria-current','false'); 919 $pager.find('a').eq(initIdx).attr('aria-current','true'); 920 } 921 922 var $controlsAuto = $t.closest('.bx-wrapper').find('.bx-controls-auto'); 923 $controlsAuto.find('.bx-start').attr('title', 'ì¬ë¼ì´ë ì¬ì').text('ì¬ì').attr('href', '#'); 924 $controlsAuto.find('.bx-start').append('<span class="blind">ì íë¨</span>'); 925 $controlsAuto.find('.bx-stop').attr('title', 'ì¬ë¼ì´ë ì ì§').text('ì ì§').attr('href', '#'); 926 $controlsAuto.find('.bx-start, .bx-stop').on('click', function(e){ 927 e.preventDefault(); 928 var $start = $controlsAuto.find('.bx-start'); 929 var $stop = $controlsAuto.find('.bx-stop'); 930 // í´ë¦ë ë²í¼ì ë°ë¼ ì ê·¼ì± ë§í¬ì ì²ë¦¬ 931 if ($(this).hasClass('bx-start')) { 932 $start.find('span.blind').remove(); 933 $start.append('<span class="blind">ì íë¨</span>'); 934 $stop.find('span.blind').remove(); 935 } else if ($(this).hasClass('bx-stop')) { 936 $stop.find('span.blind').remove(); 937 $stop.append('<span class="blind">ì íë¨</span>'); 938 $start.find('span.blind').remove(); 939 } 940 }); 941 942 var $wrapper = $t.closest('.bx-wrapper') 943 var $prevbtn = $wrapper.next('.prev'); 944 var $nextbtn = $prevbtn.next('.next'); 945 $prevbtn.find('.bx-prev').html('<span class="blind">ì´ì ì¬ë¼ì´ë ì´ë</span>'); 946 $nextbtn.find('.bx-next').html('<span class="blind">ë¤ì ì¬ë¼ì´ë ì´ë</span>'); 947 948 // íì± ì¬ë¼ì´ë aria-hidden ë³´ì 949 // bxSliderë .bx-cloneì ì¶ê°íë¯ë¡, currentIndexë "ì본" 기ì¤ì¼ë¡ í´ìí´ì¼ í¨ 950 var $allSlides = $t.children('li'); 951 var $originalSlides = $allSlides.not('.bx-clone'); 952 var idx = (typeof currentIndex === 'number') ? currentIndex : 0; 953 var $activeSlide = $originalSlides.eq(idx); 954 if(!$activeSlide.length){ 955 $activeSlide = $t.find('li[aria-hidden="false"]').not('.bx-clone').first(); 956 } 957 if(!$activeSlide.length){ 958 $activeSlide = $t.find('li.active').not('.bx-clone').first(); 959 } 960 if(!$activeSlide.length){ 961 $activeSlide = $originalSlides.first(); 962 } 963 $allSlides.attr('aria-hidden','true').find('a').attr('tabindex','-1'); 964 $activeSlide.attr('aria-hidden','false').find('a').attr('tabindex','0'); 965 966 /* var $slideList = $t.children('li'); 967 $slideList.attr('tabindex', '0');*/ 968 }, 969 onSlideBefore: function($slideElement, oldIndex, newIndex) { 970 $t.children('li').attr('aria-hidden', 'true') 971 .find('a').attr('tabindex', '-1'); 972 973 $slideElement.attr('aria-hidden', 'false') 974 .find('a').attr('tabindex', '0'); 975 }, 976 //BTOCSITE-113403 ì¬ë¼ì´ëì onSlideAfter aria-current ìì ì¶ê°(íì±í : true, ë¹ íì±í :false) 977 onSlideAfter: function($slideElement, oldIndex, newIndex) { 978 var $pager = $t.closest('.bx-wrapper').find('.bx-pager'); 979 $pager.find('a').each(function(index){ 980 if(index == newIndex){ 981 $(this).attr('aria-current','true'); 982 }else{ 983 $(this).attr('aria-current','false'); 984 } 985 }); 986 }, 987 onSliderResize: function() { 988 var $allSlides = $t.children('li'); 989 var $originalSlides = $allSlides.not('.bx-clone'); 990 var $activeSlide = $t.find('li[aria-hidden="false"]').not('.bx-clone').first(); 991 if(!$activeSlide.length){ 992 $activeSlide = $t.find('li.active').not('.bx-clone').first(); 993 } 994 if(!$activeSlide.length){ 995 $activeSlide = $originalSlides.first(); 996 } 997 $allSlides.attr('aria-hidden','true').find('a').attr('tabindex','-1'); 998 $activeSlide.attr('aria-hidden','false').find('a').attr('tabindex','0'); 999 1000 var $pager = $t.closest('.bx-wrapper').find('.bx-pager'); 1001 // íì¬ íì± pagerê° ìì¼ë©´ ê·¸ ì¸ë±ì¤ë¥¼ aria-currentë¡ ë°ì(ìì¼ë©´ 0) 1002 var activeIdx = $pager.find('a.active').index(); 1003 if(activeIdx < 0) activeIdx = 0; 1004 $pager.find('a').each(function(index){ 1005 $(this).html('<span class="blind">' + (index + 1) + 'ë² ì¬ë¼ì´ë 보기</span>'); 1006 $(this).attr('href', '#'); 1007 //BTOCSITE-113403 ì¬ë¼ì´ëì onSlideAfter aria-current ìì ì¶ê°(íì±í : true, ë¹ íì±í :false) 1008 // íì± pager 기ì¤ì¼ë¡ aria-current ë°ì 1009 if(index == activeIdx){ 1010 $(this).attr('aria-current','true'); 1011 }else{ 1012 $(this).attr('aria-current','false'); 1013 } 1014 }); 1015 $pager.find('a').on('click', function(e){
1016 e.preventDefault(); 1017 }); 1018 } 1019 } 1020 1021 if(setting.mobile){ 1022 opt.autoStart = false; 1023 } 1024 else{ 1025 opt.autoStart = true; 1026 } 1027 1028 /* 250818 ì¹ì ê·¼ì± ìì start */ 1029 if ($t.hasClass('not-auto')) { 1030 opt.autoStart = false; 1031 } 1032 /* end 250818 ì¹ì ê·¼ì± ìì */ 1033 1034 /* opt["onSliderResize"] = function($slideElement) { 1035 var $pager = $t.closest('.bx-wrapper').find('.bx-pager'); 1036 $pager.find('a').each(function(index){ 1037 $(this).html('<span class="blind">' + (index + 1) + 'ë² ì¬ë¼ì´ë 보기</span>'); 1038 $(this).attr('href', '#'); 1039 }); 1040 $pager.find('a').on('click', function(e){ 1041 e.preventDefault(); 1042 }); 1043 }*/ 1044 1045 if ($t.hasClass('uspTit')) { 1046 1047 var focusableSel = 'a,button,input,select,textarea'; 1048 1049 var prevAfter = opt.onSlideAfter; 1050 opt.onSlideAfter = function($slideElement, oldIndex, newIndex){ 1051 if (prevAfter) prevAfter($slideElement, oldIndex, newIndex); 1052 1053 (newIndex) 1054 ? $('.download').show().find('a:nth-child(' + newIndex + ')').show().siblings().hide() 1055 : $('.download').hide(); 1056 1057 var $pager = $t.closest('.bx-wrapper').find('.bx-pager'); 1058 $pager.find('a').each(function(index){ 1059 $(this).html('<span class="blind">' + (index + 1) + 'ë² ì¬ë¼ì´ë 보기</span>').attr('href','#'); 1060 //BTOCSITE-113403 ì¬ë¼ì´ëì onSlideAfter aria-current ìì ì¶ê°(íì±í : true, ë¹ íì±í :false) 1061 if(index == newIndex){ 1062 $(this).attr('aria-current','true'); 1063 }else{ 1064 $(this).attr('aria-current','false'); 1065 } 1066 }).off('click._usp').on('click._usp', function(e){ e.preventDefault(); }); 1067 }; 1068 1069 var prevLoad = opt.onSliderLoad; 1070 opt.onSliderLoad = function(currentIndex){ 1071 if (prevLoad) prevLoad(currentIndex); 1072 1073 var $all = $t.children('li'); 1074 var $original = $all.not('.bx-clone'); 1075 1076 var $active = $original.eq(currentIndex || 0); 1077 1078 $all.attr('aria-hidden','true') 1079 .find(focusableSel).attr('tabindex','-1'); 1080 1081 $active.attr('aria-hidden','false') 1082 .find(focusableSel).attr('tabindex','0'); 1083 }; 1084 1085 var prevBefore = opt.onSlideBefore; 1086 opt.onSlideBefore = function($slideElement, oldIndex, newIndex){ 1087 if (prevBefore) prevBefore($slideElement, oldIndex, newIndex); 1088 1089 $t.children('li').attr('aria-hidden','true') 1090 .find(focusableSel).attr('tabindex','-1'); 1091 1092 $slideElement.attr('aria-hidden','false') 1093 .find(focusableSel).attr('tabindex','0'); 1094 }; 1095 } else { 1096 // 기존 onSlideAfter(aria-current ê°±ì ë±)를 ë®ì´ì°ì§ ìëë¡ ë³´ì¡´ 1097 // (ì´ì ì½ëììë ì¬ê¸°ì ë¹ í¨ìë¡ overwrite ëì´ hero-products ë±ìì aria-currentê° ê³ ì ëë 문ì ê° ë°ì) 1098 if(!opt.onSlideAfter){ 1099 opt.onSlideAfter = function($slideElement, oldIndex, newIndex) {}; 1100 } 1101 } 1102 if ($t.hasClass('thumb_pager')) { 1103 // condition for uspTitle 1104 $.extend(opt, { 1105 pagerCustom : '#custompager', 1106 pagerActiveClass : 'on' 1107 }); 1108 1109 } 1110 if ($t.hasClass('thumb_pager2')) { 1111 // condition for uspTitle 1112 $.extend(opt, { 1113 pagerCustom : '#custompager2', 1114 pagerActiveClass : 'on' 1115 }); 1116 1117 } 1118 $t.bxSlider(opt); 1119 } 1120 1121 } else { 1122 console.log('bxSlider íë¬ê·¸ì¸ì´ íìí©ëë¤.'); 1123 } 1124 1125 1126 1127 }); 1128 1129 /* type04 */ 1130 $('.type04').each(function() { 1131 var $t = $(this) 1132 1133 // front, mobile separate 1134 if ($t.hasClass((setting.mobile ? '.onM' : '.onW'))) { 1135 return false 1136 } 1137 1138 $('.slideC', $t).on({ 1139 "click" : function() { 1140 $('.slideF li', $t).eq($(this).index()).addClass('on').siblings().removeClass('on'); 1141 $(this).addClass('on').siblings().removeClass('on'); 1142 } 1143 }, '>*'); 1144 }); 1145} 1146 1147var sliderSlick = function (){ 1148 if((document.querySelector('.slide-module-b27') && setting.web) || document.querySelector('.slideSl') || document.querySelector('.sl-slide')) { 1149 if(jQuery().slick) { 1150 var opt = { 1151 arrows : true, 1152 prevArrow : '<button type="button" class="slick-prev sp"><span class="blind">ì´ì ì¬ë¼ì´ë ì´ë</span></button>', 1153 nextArrow : '<button type="button" class="slick-next sp"><span class="blind">ë¤ì ì¬ë¼ì´ë ì´ë</span></button>', 1154 dots : true, 1155 draggable : setting.mobile, 1156 customPaging: function(slider, i) { 1157 return '<button type="button" aria-label="' + (i + 1) + 'ë² ì¬ë¼ì´ë 보기"><span class="blind">' + (i + 1) + ' ë² ì¬ë¼ì´ë 보기</span></button>'; 1158 } 1159 } 1160 1161 var handleTabindex = function(slider) { 1162 slider.$slider.find('.slick-slide a').attr('tabindex', '-1'); 1163 slider.$slider.find('.slick-active a').attr('tabindex', '0'); 1164 }; 1165 1166 // slick dots(íì´ì§ë¤ì´ì ) aria-current ì²ë¦¬ 1167 var updateSlickDotsAriaCurrent = function(slider){
1168 if(!slider || !slider.$slider) return; 1169 var $dots = slider.$slider.find('.slick-dots'); 1170 if(!$dots.length) return; 1171 $dots.find('li button').attr('aria-current','false'); 1172 $dots.find('li.slick-active button').attr('aria-current','true'); 1173 if (slider.$slider.is('.slideSl')) { 1174 $dots.add($dots.find('*')).removeAttr('aria-hidden'); 1175 } 1176 }; 1177 1178 // slickì´ ìëì¼ë¡ ë¶ì¬íë role="option" ì ê±°(í¹ì ì¬ë¼ì´ëììë§ íì²ë¦¬ë¡ ì¬ì©) 1179 var stripSlickOptionRole = function($slider){ 1180 if(!$slider || !$slider.length) return; 1181 // slick ë²ì ì ë°ë¼ role="option"ì´ slick-slide(ëê° li/div)ì ë¶ì 1182 $slider.find('[role="option"].slick-slide, .slick-slide[role="option"]').each(function(){ 1183 this.removeAttribute('role'); 1184 this.removeAttribute('aria-describedby'); 1185 }); 1186 $slider.find('.slick-track[role="listbox"]').removeAttr('role'); 1187 }; 1188 // postSlideìì afterChange ì§í initADA()ê° roleì ë¤ì ë¶ì´ë¯ë¡, ë¤ì í±ì ì ê±° 1189 var stripSlickOptionRoleAfterADA = function($slider){ 1190 setTimeout(function(){ stripSlickOptionRole($slider); }, 0); 1191 }; 1192 1193 var slickAfterEvent = function(event, slick, currentSlide) { 1194 var currentSlide = currentSlide || 0; 1195 var division = slick.options.slidesToShow; 1196 var last = slick.slideCount; 1197 1198 if (currentSlide <= 0) { 1199 $('.slick-prev', this).hide(); 1200 $('.slick-next', this).show(); 1201 } else if (currentSlide + division >= last) { 1202 $('.slick-prev', this).show(); 1203 $('.slick-next', this).hide(); 1204 } else { 1205 $('.slick-prev', this).show(); 1206 $('.slick-next', this).show(); 1207 } 1208 1209 handleTabindex(slick); 1210 updateSlickDotsAriaCurrent(slick); 1211 stripSlickOptionRoleAfterADA(slick.$slider); 1212 }; 1213 1214 var slickInitEvent = function(e, slick) { 1215 handleTabindex(slick); 1216 updateSlickDotsAriaCurrent(slick); 1217 stripSlickOptionRole(slick.$slider); 1218 }; 1219 1220 $('.slide-module-b27').each(function(){ 1221 var $t = $(this); 1222 var _inTabList = $t.closest('#tabList').length > 0; 1223 1224 // web(PC)ììë§ aria-selected/ì íë¨ ë° tabindex ì ì´ ì ì© 1225 if(setting && setting.mobile){ 1226 return; 1227 } 1228 1229 $t.find('a, button, input, select, textarea').attr('tabindex', -1); 1230 1231 function updateSlickTabindex() { 1232 $t.find('li.slick-slide').find('a, button, input, select, textarea').attr('tabindex', -1); 1233 $t.find('li.slick-slide.slick-active[aria-hidden="false"], li.slick-slide.slick-active:not([aria-hidden])') 1234 .find('a, button, input, select, textarea') 1235 .attr('tabindex', 0); 1236 1237 var $focused = $(':focus'); 1238 if ($focused.length && $focused.closest('li.slick-slide[aria-hidden="true"]').length) { 1239 var $visibleFirst = $t.find('li.slick-slide.slick-active[aria-hidden="false"]') 1240 .add($t.find('li.slick-slide.slick-active:not([aria-hidden])')) 1241 .first() 1242 .find('a, button, input, select, textarea') 1243 .filter(':visible') 1244 .first(); 1245 if ($visibleFirst.length) $visibleFirst.focus(); 1246 } 1247 } 1248 1249 function updateSlickSelectedFlag() { 1250 $t.find('li.slick-slide span.blind.selected-flag').remove(); 1251 // #tabList íìì¼ ëë§ "ì íë¨" ë¸ë¼ì¸ë í ì¤í¸ ì ì© 1252 if(!_inTabList) return; 1253 1254 var $onItem = $t.find('li.on').not('.slick-cloned').first(); 1255 if($onItem.length === 0){ 1256 $onItem = $t.find('li').not('.slick-cloned').first().addClass('on'); 1257 } 1258 var $selectedControl = $onItem.find('>a, >button, >span[role="tab"]').first(); 1259 if ($selectedControl.length && $selectedControl.find('span.blind.selected-flag').length === 0) { 1260 $selectedControl.append('<span class="blind selected-flag">ì íë¨</span>'); 1261 } 1262 } 1263 1264 if ($t.find('>li').length > 5) { 1265 // aria-selected ì ì´ ê¸°ë¥ ì ê±°: 기존 ìì±ë ì´ê¸°í 1266 $t.find('>li>a, >li>button, >li span[role="tab"]').removeAttr('aria-selected'); 1267 1268 $t.slick($.extend({}, opt, { 1269 slidesToShow: 5, 1270 slidesToScroll: 1, 1271 draggable: false, 1272 dots: false, 1273 initialSlide: Math.max($t.find('li.on').index(), 0) 1274 })) 1275 .on('init reInit setPosition afterChange', function(e, slick){ 1276 requestAnimationFrame(function(){ 1277 updateSlickTabindex(); 1278 updateSlickSelectedFlag(); 1279 updateSlickDotsAriaCurrent(slick); 1280 });
1281 }); 1282 1283 // ì´ê¸° ë¡ë© ì init ì´ë²¤í¸ ëë½ ì¼ì´ì¤ ë³´ì 1284 requestAnimationFrame(function(){ 1285 updateSlickTabindex(); 1286 updateSlickSelectedFlag(); 1287 updateSlickDotsAriaCurrent($t.slick('getSlick')); 1288 }); 1289 } 1290 else { 1291 $t.find('.selected-flag').remove(); 1292 $t.find('>li>a, >li>button, >li span[role="tab"]').each(function(){ 1293 $(this).removeAttr('tabindex').removeAttr('aria-selected'); 1294 }); 1295 var $on = $t.find('>li.on'); 1296 if($on.length === 0){ 1297 $on = $t.find('>li').first().addClass('on'); 1298 } 1299 var $anchor = $on.find('>a, >button, span[role="tab"]').first(); 1300 $anchor.removeAttr('aria-selected'); 1301 if(_inTabList){ 1302 $anchor.append('<span class="blind selected-flag">ì íë¨</span>'); 1303 } 1304 } 1305 }); 1306 1307 $('.slideSl').each(function(){ 1308 var $t = $(this); 1309 1310 if(setting.mobile && $t.children('li').length < 2) 1311 return false; 1312 1313 // init ì´ë²¤í¸ë slick() í¸ì¶ ì ì¦ì ë°ìíë¯ë¡, ë°ëì slick() í¸ì¶ ì ì ë°ì¸ë©í´ì¼ ëì¹ì§ ìì 1314 $t.off('init._a11ySlick afterChange._a11ySlick reInit._a11ySlick setPosition._a11ySlick') 1315 .on('init._a11ySlick', slickInitEvent) 1316 .on('afterChange._a11ySlick', slickAfterEvent) 1317 .on('reInit._a11ySlick setPosition._a11ySlick', function(e, slick){ 1318 handleTabindex(slick); 1319 updateSlickDotsAriaCurrent(slick); 1320 stripSlickOptionRoleAfterADA(slick.$slider); 1321 }); 1322 1323 $t.slick($.extend({},opt,{ 1324 slidesToShow: (setting.mobile) ? 2 : 4, 1325 slidesToScroll: (setting.mobile) ? 2 : 4, 1326 arrows : !setting.mobile, 1327 accessibility: false 1328 })); 1329 1330 // ì´ê¸° ìí 1í ë³´ì (íê²½ì ë°ë¼ init ì´ë²¤í¸ë¥¼ ëì¹ë ì¼ì´ì¤ ëë¹) 1331 try{ 1332 var _slick = $t.slick('getSlick'); 1333 handleTabindex(_slick); 1334 updateSlickDotsAriaCurrent(_slick); 1335 stripSlickOptionRole($t); 1336 }catch(e){} 1337 }); 1338 1339 if(setting.mobile) { 1340 1341 if($('div').hasClass('absoluted')){//ì¤ì¹ì¬ë¡ IT>ë¡ë´ 1ê±´ ê¸°ì¤ slideê¸°ë¥ ì ì§ 1342 $('.review-box div').removeClass('reviewsF'); 1343 } 1344 $('.reviewsF .sl-slide').each(function(){ 1345 var $t = $(this); 1346 if ($t.children('li').length < 2) return false; 1347 1348 // init ì´ë²¤í¸ ëë½ ë°©ì§ ìí´ slick() í¸ì¶ ì ì ë°ì¸ë© 1349 $t.off('init._a11ySlick afterChange._a11ySlick reInit._a11ySlick setPosition._a11ySlick') 1350 .on('init._a11ySlick', slickInitEvent) 1351 .on('afterChange._a11ySlick', slickAfterEvent) 1352 .on('reInit._a11ySlick setPosition._a11ySlick', function(e, slick){ 1353 handleTabindex(slick); 1354 updateSlickDotsAriaCurrent(slick); 1355 stripSlickOptionRoleAfterADA(slick.$slider); 1356 }); 1357 1358 $t.slick($.extend({}, opt, { 1359 centerMode: 1, 1360 speed: 300, 1361 accessibility: false, 1362 arrows : true, 1363 prevArrow : '<button type="button" class="slick-prev slick-control-btn"><span class="blind">ì´ì ì¬ë¼ì´ë ì´ë</span></button>', 1364 nextArrow : '<button type="button" class="slick-next slick-control-btn"><span class="blind">ë¤ì ì¬ë¼ì´ë ì´ë</span></button>', 1365 dots: false, 1366 slidesToScroll: 1, 1367 draggable: true 1368 })); 1369 1370 // ì´ê¸°í ì§í 1í ë³´ì 1371 try{ 1372 var _slick2 = $t.slick('getSlick'); 1373 handleTabindex(_slick2); 1374 updateSlickDotsAriaCurrent(_slick2); 1375 stripSlickOptionRole($t); 1376 }catch(e){} 1377 }); 1378 $('.slideSl').each(function(){ 1379 try { 1380 var $t = $(this); 1381 stripSlickOptionRole($t); 1382 updateSlickDotsAriaCurrent($t.slick('getSlick')); 1383 } catch (e) {} 1384 }); 1385 } 1386 1387 } else { 1388 console.log('slick íë¬ê·¸ì¸ì´ íìí©ëë¤.'); 1389 } 1390 } 1391} 1392 1393/* fixToMobile */ 1394var fixToMobile = { 1395 option : {widthSize : 760}, 1396 init : function(o) { 1397 $.extend(this.option, o); 1398 this.option.wrap.wrap($('<div/>').css('overflow','hidden')); 1399 this.rezoom(); 1400 this.bind(); 1401 return this; 1402 }, 1403 bind : function() { 1404 $(window).on({ 'resize' : this.rezoom }); 1405 1406 fixToMobile.option.wrap.on({ 1407 'click' : this.rezoom 1408 }, '.tab-link a').on({ 1409 "click" : function(e) { 1410 e.preventDefault(); 1411 $(window).scrollTop($($(this).attr('href')).offset().top || 0) 1412 } 1413 }, '.new_tabMenu a') 1414 1415 }, 1416 rezoom : function() { 1417 var winwid= $(window).width(); 1418 var wid= winwid-10; 1419 var rate = wid / fixToMobile.option.widthSize; 1420 var scaleWrapC = $('#scaleWrap').length ? fixToMobile.option.wrap.find("#scaleWrap") : fixToMobile.option.wrap.wrapInner("<div id='scaleWrap'/>").find('>div'); 1421 1422 if($('.contents-inner').children().hasClass('installation_content')) return; 1423 //console.log($(window).width(),fixToMobile.option.widthSize); 1424 scaleWrapC.css({ 1425 '-webkit-transform' : 'scale(' + rate + ')', 1426 '-moz-transform' : 'scale(' + rate + ')', 1427 '-ms-transform' : 'scale(' + rate + ')', 1428 '-o-transform' : 'scale(' + rate + ')', 1429 'transform' : 'scale(' + rate + ')', 1430 '-webkit-transform-origin' : "10px top", 1431 '-moz-transform-origin' : "10px top", 1432 '-ms-transform-origin' : "10px top", 1433 '-o-transform-origin' : "10px top", 1434 'transform-origin' : "10px top" 1435 }); 1436 1437 1438 var tgrWrap = fixToMobile.option.wrap; 1439 setTimeout(function(){ 1440 tgrWrap.width(fixToMobile.option.widthSize).height($('#scaleWrap').height()*rate ).css({"overflow":"hidden"}).removeAttr('width').width(''); 1441 1442 if($('#scaleWrap').width() <= $(window).width()){ 1443 $('#scaleWrap').width((function(){return $('#scaleWrap').parent().width() / rate})()) 1444 } 1445 },100); 1446 } 1447}; 1448 1449var datepicker = function() { 1450 1451 if(document.querySelector('.date-picker')) { 1452 if(jQuery().datepicker) { 1453 $('.date-picker').datepicker({ 1454 1455 dateFormat: "yy-mm", 1456 changeMonth: true, 1457 changeYear: true, 1458 showButtonPanel: true, 1459 currentText : 'ì¤ë', 1460 closeText : 'ì ì©', 1461 monthNamesShort: ['1ì','2ì','3ì','4ì','5ì','6ì','7ì','8ì','9ì','10ì','11ì','12ì'], 1462 onClose: function(dateText, inst) { 1463 function isDonePressed(){ 1464 return ($('#ui-datepicker-div').html().indexOf('ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all ui-state-hover') > -1); 1465 } 1466 1467 if (isDonePressed()){
1468 var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val(); 1469 var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val(); 1470 $(this).datepicker('setDate', new Date(year, month, 1)).trigger('change'); 1471 1472 $('.date-picker').focusout() 1473 } 1474 }, 1475 beforeShow : function(input, inst) { 1476 1477 inst.dpDiv.addClass('month_year_datepicker') 1478 1479 if ((datestr = $(this).val()).length > 0) { 1480 year = datestr.substring(datestr.length-4, datestr.length); 1481 month = datestr.substring(0, 2); 1482 $(this).datepicker('option', 'defaultDate', new Date(year, month-1, 1)); 1483 $(this).datepicker('setDate', new Date(year, month-1, 1)); 1484 } 1485 } 1486 }) 1487 1488 } else { 1489 console.log('jqueryUI datepickerê° ììµëë¤.') 1490 } 1491 } 1492}; 1493 1494var goTop = function() { 1495 if (!document.querySelector('.move-top')) { 1496 1497 // Create top-btn 1498 var $btnTop = $('<div class="move-top"><a href="#top" title="ì²ìì¼ë¡ ì´ë" class="sp">go top</a></div>').appendTo('body'); 1499 1500 // Scroll top-btn 1501 //BTOCSITE-111533 ì¤í¬ë¡¤ ì´ë ì focus ìì 1502 $btnTop.children('a').click(function() { 1503 $('html,body').animate({scrollTop : 0}, 300, 'swing', function() { 1504 setTimeout(function() { 1505 var logoLink = $('.gnb-main-container h2 a.logo'); 1506 console.log("logoLink.length==>"+logoLink.length); 1507 if (logoLink.length) { 1508 logoLink.focus(); // h2ìì a.logo focusì´ë 1509 } 1510 }, 100); // 100ms ì§ì° 1511 }); 1512 return false; 1513 }); 1514 1515 $(window).on('scroll', function() { 1516 ($(this).scrollTop() > $('.gnb-main-container').height()) ? $btnTop.addClass('show') : $btnTop.removeClass('show'); 1517 }) 1518 } 1519} 1520 1521/*tab function*/ 1522var tabFunction = function(o){ 1523 var option = o, btnsBox = option.btns, tabCont = option.cont, totalOpt = 0; 1524 1525 if(btnsBox.children().length > tabCont.children().length){ 1526 totalOpt++; 1527 }else{ 1528 tabCont.children().eq(0).show().siblings().hide(); 1529 } 1530 1531 btnsBox.on({ 1532 "click" : function(e){ 1533 e.preventDefault(); 1534 var $t = $(this); 1535 $t.addClass('on').parent().addClass('on').siblings().removeClass('on'); 1536 1537 var thisIdx = ($t.siblings().length) ? $t.index() : $t.parent().index(); 1538 1539 tabCont.children().eq(thisIdx - totalOpt).show().siblings().hide(); 1540 1541 /*old usp only&best tab*/ 1542 if(totalOpt && !thisIdx){ 1543 tabCont.children().show(); 1544 } 1545 1546 } 1547 },'a, button'); 1548 1549}; 1550 1551var appendMS = function(target) { 1552 var option = { 1553 self : document.createElement('div'), 1554 parent : document.querySelector(target), 1555 text : "LGì ìë Windows를 ê¶ì¥í©ëë¤.", 1556 link : "http://www.lge.co.kr/lgekr/microsite/pc/2016/8/windows10/UpdateInfo.htmlggkg", 1557 image : "/kr/business/asset/images/common/Windows10_MDA_Tag_EA_KO_Blue_180x31.png", 1558 alt : "Windows10 ìì 보기" 1559 }; 1560 1561 if($(option.parent).find('.ms-noti').length) 1562 return false; 1563 1564 $.extend(option,target); 1565 with(option) { 1566 self.setAttribute('class','ms-noti'); 1567 self.innerHTML = text; 1568 self.innerHTML += '<a href="' + link + '" target="_blank">Windows 10 ì ë°ì´í¸ ì ë³´</a>'; 1569 //$(parent).prepend(self); 1570 } 1571} 1572 1573 // sns ê³µì ì ì¬ì©ë short Url ìì± 1574var BITLY_V4_TOKEN = window.BITLY_V4_TOKEN || ''; // ì ì 주ì ê°ë¥ 1575 1576function goSnsShortURL(longURL, snsType){ 1577 // ì´ë¯¸ ì¸ì½ë©ë ê° ë¤ì´ì¬ ì ìì¼ë ëì½ë í ì¬ì¬ì© 1578 var originalUrl = decodeURIComponent(longURL); 1579 1580 // í í° ìì¼ë©´ ì¦ì fallback 1581 if(!BITLY_V4_TOKEN){ 1582 successUrl(originalUrl, snsType); 1583 return Promise.resolve(originalUrl); 1584 } 1585 1586 return fetch('https://api-ssl.bitly.com/v4/shorten', { 1587 method: 'POST', 1588 headers: { 1589 'Authorization': 'Bearer ' + BITLY_V4_TOKEN, 1590 'Content-Type': 'application/json' 1591 }, 1592 body: JSON.stringify({ long_url: originalUrl }) 1593 }) 1594 .then(function(res){ 1595 if(!res.ok) throw new Error('Bitly shorten failed: ' + res.status); 1596 return res.json(); 1597 }) 1598 .then(function(data){ 1599 var shortUrl = (data && data.link) ? data.link : originalUrl; 1600 successUrl(shortUrl, snsType); 1601 return shortUrl; 1602 }) 1603 .catch(function(err){ 1604 console.warn('[Bitly] fallback to original URL:', err.message); 1605 successUrl(originalUrl, snsType); 1606 return originalUrl; 1607 });
1608} 1609 1610 1611// sns ê³µì ì ì¬ì©ë short Url ìì±ì ì¬ì©ëë ì½ë°±í¨ì 1612function successUrl(url,snsType){ 1613 getSnsOpenPop(url,snsType); 1614} 1615 1616// ê³µì ë²í¼ í´ë¦ì 1617function goSns(type){ 1618 var el = document.getElementById('snsUrl'); 1619 if(!el){ console.warn('snsUrl element not found'); return; } 1620 var snsUrl = el.value; 1621 // Promise ë°í (íì ì ì¬ì©) 1622 return goSnsShortURL(snsUrl, type); 1623} 1624window.goSns = goSns; 1625 1626//ì¤ì ë¡ ê³µì 기ë¥ì í¸ì¶íë í¨ì. 1627function getSnsOpenPop(url,snsType){ 1628 var snsTitle = document.getElementById("snsTitle").value; 1629 var facebookUrl = document.getElementById("facebookUrl").value; 1630 var snsUrl = ""; 1631 1632 if("T" == snsType){ 1633 snsUrl = "http://twitter.com/intent/tweet?text="+encodeURIComponent(snsTitle+"\n"+url); 1634 snsLinkName = "twitter_pop"; 1635 }else if("F" == snsType){ 1636 snsUrl = "http://www.facebook.com/sharer.php?u="+encodeURIComponent(facebookUrl); 1637 snsLinkName = "facebook_pop"; 1638 } 1639 1640 if(snsUrl != ""){ 1641 window.open(snsUrl, snsLinkName,""); 1642 } 1643 1644} 1645 1646// ì¤í¬ë© url ë³µì¬ 1647function clipBoardUrl2(me, val) { 1648 var clip = new ZeroClipboard.Client(); 1649 clip.setHandCursor( true ); 1650 clip.glue(me); 1651 1652 clip.addEventListener('mouseOver', function (client) { 1653 clip.setText( val ); 1654 }); 1655 1656 clip.addEventListener('complete', function (client, text) { 1657 brndCntLayer('scrap'); 1658 }); 1659} 1660 1661// ì¤í¬ë© ë²í¼ë³ë¡ ì´ë²¤í¸ë¥¼ ë±ë¡íë í¨ì 1662/* 1663function scrapButtonFunc() { 1664 $('.scrapButton').each( function() { // ì¤í¬ë© ë²í¼ë³ë¡ ìë ì¡ì ì ë±ë¡ 1665 var clipTxt = document.location.href; 1666 if(parent && parent!=this) { 1667 clipTxt = parent.document.location.href; 1668 } 1669 var optVal = 0; 1670 if ( $(this).attr('data-url') ) { // ë³ë urlì ë³µì¬í´ì¼ í ê²½ì° í´ë¹ urlì ê°ì data-url attributeì ì í 1671 clipTxt = $(this).attr('data-url'); 1672 } else if ( $(this).attr('data-scrapid') != null && $(this).attr('data-scrapid') != '' ) { // data-scrapidì ë³µì¬í í ì¤í¸ê° ìë divì id를 ì í 1673 if ( $.browser.msie && $.browser.version<9 ) { 1674 clipTxt = document.getElementById( $(this).attr('data-scrapid') ).innerText; 1675 } else { 1676 clipTxt = document.getElementById( $(this).attr('data-scrapid') ).textContent; 1677 } 1678 optVal = 1; 1679 } else if ( $(this).attr('data-param') ) { // ë³ë urlì ë³µì¬í´ì¼ í ê²½ì° í´ë¹ urlì ê°ì data-url attributeì ì í 1680 clipTxt = document.location.href + "?" + $(this).attr('data-param'); 1681 clipTxt = clipTxt.replace("#",""); 1682 } 1683 $(this).css({'position':'relative','display':'inline-block'}).children('.alt_scrap').val(clipTxt).text(clipTxt); 1684 1685 $(this).mouseover(function () { 1686 setting.web && clipBoardUrl($(this)[0], clipTxt, optVal); 1687 }); 1688 $(this).children('input, span').mouseover(function () { 1689 return false; 1690 }); 1691 $(this).children('.alt_scrap').focus( function() { 1692 $(this).val('').html('').val(clipTxt).text(clipTxt); 1693 $(this).select(); 1694 $(this).parent().children('.infor_scrap').show(); 1695 }); 1696 $(this).children('.alt_scrap').blur( function() { 1697 $(this).parent().children('.infor_scrap').hide(); 1698 }); 1699 }); 1700} 1701*/ 1702 1703//í´ë¦½ë³´ë 1704function clipBoardUrl(me, val, opt) { // ì¤í¬ë© ë²í¼ì ë§ì°ì¤ë¥¼ ì¬ë¦¬ë©´ íëìë²í¼ì ë¡ëíë©°, í´ë¦íë©´ ê°ì ë³µì¬í í ìë completeì í´ë¹íë ì¡ì ì ì¤í 1705 var clip = new ZeroClipboard.Client(); 1706 ZeroClipboard.setMoviePath('/kr/business/asset/flash/ZeroClipboard.swf'); 1707 clip.setHandCursor( true ); 1708 clip.glue(me); 1709 clip.setText(val); 1710 clip.addEventListener('complete', function (client, text) { 1711 brndCntLayer('scrap'); // 기존 ë ì´ì´ ì림 1712 }); 1713 1714} 1715 1716//ì¤í¬ë© ë° ì´ë¯¸ì§ 미리보기 - 2012.06.29 lim. 1717function brndCntLayer(wrapId,imgFileName,opener){ // [wa2013] 2013.01.04 doh : opener ë³ì ì¶ê° (ì´ìë ë²í¼ì¼ë¡ ë¤ì í¬ì»¤ì¤ ë³´ë´ê¸° ìí´) 1718 if(wrapId=="scrap"){ 1719 // ì¤í¬ë© ë ì´ì´ íì 1720 try{ 1721 if(parent && parent!=this) { 1722 parent.popup.msg({title:'',msg:'íì´ì§ì URLì´ ë³µì¬ëììµëë¤. ìíìë íì´ì§ì ë¶ì¬ë£ê¸°(Ctrl+V)를 íì¸ì.'}); 1723 } else { 1724 popup.msg({title:'',msg:'íì´ì§ì URLì´ ë³µì¬ëììµëë¤. ìíìë íì´ì§ì ë¶ì¬ë£ê¸°(Ctrl+V)를 íì¸ì.'}); 1725 } 1726 1727 }catch(e){ 1728 alert('íì´ì§ì URLì´ ë³µì¬ëììµëë¤. ìíìë íì´ì§ì ë¶ì¬ë£ê¸°(Ctrl+V)를 íì¸ì.'); 1729 $("div.pop.openURL").hide(); 1730 } 1731 1732 }else if(wrapId=="thumb_zoom"){ 1733 // ì´ë¯¸ì§ 미리보기 ë ì´ì´ íì 1734 1735 } 1736 1737} 1738 1739// kakao talk init 1740function fnCommonKakaoInit(appKey){ 1741 appKey = appKey || '1847eef5a1516913f315bdfbd1fbc03e'; 1742 if(!window.Kakao){ 1743 console.error('Kakao SDK not loaded'); 1744 return; 1745 } 1746 if(!Kakao.isInitialized()) Kakao.init(appKey); 1747 } 1748 1749 function fnCommonKakaoLink(label,imgSrc,imgWidth,imgHeight,webButtonText,webButtonUrl){ 1750 fnCommonKakaoInit(); // íì ì ì´ê¸°í 1751 if(!window.Kakao || !Kakao.isInitialized()){ 1752 alert('ì¹´ì¹´ì¤ ê³µì 를 ì¬ì©í ì ììµëë¤.'); 1753 return; 1754 } 1755 var shareUrl = (webButtonUrl || location.href).split('#')[0]; 1756 var shareTitle = label || document.title; 1757 var shareDesc = label || ''; 1758 var shareImg = imgSrc || (document.querySelector('meta[property="og:image"]')?.content) || 'https://www.lge.co.kr/lg5-common/images/header/logo-b2b.png'; 1759 1760 try{ 1761 Kakao.Share.sendDefault({ 1762 objectType:'feed', 1763 content:{ 1764 title: shareTitle, 1765 description: shareDesc, 1766 imageUrl: shareImg, 1767 link:{ mobileWebUrl: shareUrl, webUrl: shareUrl } 1768 }, 1769 buttons:[{ 1770 title: webButtonText || 'ìì¸í 보기', 1771 link:{ mobileWebUrl: shareUrl, webUrl: shareUrl } 1772 }] 1773 }); 1774 }catch(e){ 1775 console.error('Kakao share error', e); 1776 alert('ì¹´ì¹´ì¤ ê³µì ì¤ ì¤ë¥ê° ë°ìíìµëë¤.'); 1777 } 1778 } 1779 window.fnCommonKakaoLink = fnCommonKakaoLink; 1780//ì¤í¬ë© ë° ì´ë¯¸ì§ 미리보기 - 2012.06.29 lim. 1781function brndCntLayer(wrapId,imgFileName,opener){ // [wa2013] 2013.01.04 doh : opener ë³ì ì¶ê° (ì´ìë ë²í¼ì¼ë¡ ë¤ì í¬ì»¤ì¤ ë³´ë´ê¸° ìí´) 1782 if(wrapId=="scrap"){ 1783 // ì¤í¬ë© ë ì´ì´ íì 1784 try{ 1785 if(parent && parent!=this) { 1786 parent.popup.msg({title:'',msg:'íì´ì§ì URLì´ ë³µì¬ëììµëë¤. ìíìë íì´ì§ì ë¶ì¬ë£ê¸°(Ctrl+V)를 íì¸ì.'}); 1787 } else { 1788 popup.msg({title:'',msg:'íì´ì§ì URLì´ ë³µì¬ëììµëë¤. ìíìë íì´ì§ì ë¶ì¬ë£ê¸°(Ctrl+V)를 íì¸ì.'}); 1789 } 1790 1791 }catch(e){ 1792 alert('íì´ì§ì URLì´ ë³µì¬ëììµëë¤. ìíìë íì´ì§ì ë¶ì¬ë£ê¸°(Ctrl+V)를 íì¸ì.'); 1793 $("div.pop.openURL").hide(); 1794 } 1795 1796 }else if(wrapId=="thumb_zoom"){ 1797 // ì´ë¯¸ì§ 미리보기 ë ì´ì´ íì 1798 1799 } 1800 1801} 1802
1803// íì´ì§ URL ê°ì ¸ì¤ê¸° 1804function fnCommonGetUrl(urlMeta, altMessage){ 1805 if(urlMeta != "" ){ 1806 const tempTextarea = document.createElement("textarea"); 1807 document.body.appendChild(tempTextarea); 1808 tempTextarea.value = urlMeta; 1809 tempTextarea.select(); 1810 document.execCommand("copy"); 1811 document.body.removeChild(tempTextarea); 1812 } 1813 if(altMessage != ""){ 1814 alert(altMessage); 1815 } 1816 1817} 1818 1819 1820 1821 1822/* 250401 video caption area */ 1823var videoCaptionArea = function() { 1824 $('.video-caption-area').each(function(idx){ 1825 var cont = $(this).find('.video-caption-cont'); 1826 var btnOpen; 1827 if(!$(this).find('.btn-caption-open').attr('onclick')) { 1828 $(this).find('.video-caption-player').length ? btnOpen = $(this).find('.video-caption-player').find('.btn-caption-open') : btnOpen = cont.find('.btn-caption-open'); 1829 var btnDTxt = btnOpen.attr('data-default-txt'); 1830 var btnCTxt = btnOpen.attr('data-change-txt'); 1831 var btnClose = cont.find('.btn-caption-close'); 1832 var btnCloseDTxt = btnClose.attr('data-default-txt'); 1833 btnOpen.attr('aria-expanded','false').find('span').text(btnDTxt); 1834 btnClose.find('span').text(btnCloseDTxt); 1835 btnOpen.click(function(e){ 1836 e.preventDefault(); 1837 if(!cont.hasClass('active')){ 1838 cont.addClass('active').find('.video-caption').focus(); 1839 $(this).attr('aria-expanded','true'); 1840 if($(this).attr('data-change-txt')) $(this).find('span').text(btnCTxt); 1841 }else{ 1842 cont.removeClass('active'); 1843 $(this).attr('aria-expanded','false').find('span').text(btnDTxt); 1844 } 1845 }); 1846 btnClose.click(function(e){ 1847 e.preventDefault(); 1848 cont.removeClass('active'); 1849 btnOpen.attr('aria-expanded','false').focus().find('span').text(btnDTxt); 1850 }); 1851 } 1852 }); 1853} 1854/* // 250401 video caption area */ 1855 1856/*init*/ 1857var init = function() { 1858 1859 /* usp uspInit */ 1860 $('#replaceBox').length && uspInit(); 1861 1862 /*old usp fixtomobile*/ 1863 if(setting.mobile){ 1864 if(document.getElementById('contentArea')) { 1865 fixToMobile.init({ 1866 wrap : $('#contentArea'), 1867 widthSize : $('#contentArea').width() 1868 }); 1869 } else if(document.getElementById('usp-old')) { 1870 fixToMobile.init({ 1871 wrap : $('#usp-old'), 1872 widthSize : $('#usp-old').width() 1873 }); 1874 } 1875 } 1876 1877 /* usp3.0 ancher fix */ 1878 $('.etc_top_1 a[href^=#]').on('click',function(){ 1879 setTimeout(function(){ $('.tab_detail_type_1').scrollTop(0); },100); 1880 }); 1881 1882 if(setting.mobile){ 1883 $('.tab_detail_type_1').on('click',"a[href^='#']",function(e){ 1884 e.preventDefault(); 1885 var $t = $(this),$tA = $t.attr('href'); 1886 $(window).scrollTop($($tA).offset().top || 0); 1887 //$($tA).show().siblings().hide(); 1888 1889 if($($tA).is('.tab_features_top')){ 1890 $($tA).siblings().show(); 1891 $(window).scrollTop(0) 1892 } 1893 }) 1894 1895 }; 1896 1897 1898 1899 /* simulation check */ 1900 $(document).on('click','a[href]',function(e){ 1901 var thisHref = $(this).attr('href'); 1902 /* 2017.03.22 ì ì¢ ìì¸ì²ë¦¬ ìì 1903 if(thisHref.indexOf('sim=true')>0){ 1904 e.preventDefault(); 1905 if(setting.web || setting.pad){ 1906 window.open(thisHref,"simulation","left=0,top=0,width=1200,height=700,menubar=0,toolbar=0,location=0,status=0,resizeable=0,scrollbars=0"); 1907 }else{ 1908 location.href = "/kr/business/contents/installation/case-list.do?division=BUSINESS&code=" + thisHref.split('?code=')[1].replace('&sim=true','') 1909 } 1910 }else if(thisHref.indexOf('light=true')>0){ 1911 e.preventDefault(); 1912 window.open(thisHref,"experience","left=0,top=0,width=1024,height=800,menubar=0,toolbar=0,location=0,status=0,resizeable=0,scrollbars=0"); 1913 } 1914 */ 1915 if(thisHref.indexOf('light=true')>0){ 1916 e.preventDefault(); 1917 window.open(thisHref,"experience","left=0,top=0,width=1024,height=800,menubar=0,toolbar=0,location=0,status=0,resizeable=0,scrollbars=0"); 1918 } 1919 }); 1920 1921 /* featureBtns btn on */ 1922 if(document.querySelector('.featureBtns')){ 1923 var featureTop = $('#featureBtnsWrap').offset().top; 1924 $('.featureBtns').on('click','a',function(){ 1925 var $a = $(this); 1926 // 기존 title(ì: 기ì ìë£ ë¤ì´ë¡ë)ì ë³´ì¡´í´ ë기 1927 if(!$a.data('base-title') && $a.attr('title')){ 1928 $a.data('base-title', $a.attr('title'));
1929 } 1930 1931 $a.parent().addClass('on').siblings().removeClass('on').siblings().find('a').removeAttr('title'); 1932 1933 // ìì°½ ë§í¬(fnSpecInfoDownClick, window.open, target=_blank ë±)ë titleì "ìì°½ ì´ë¦¼" 문구를 ì ì§íê³ ì íë¨ í기 1934 var onclickVal = (($a.attr('onclick') || '') + ($a.attr('onClick') || '')).toLowerCase(); 1935 var baseTitle = String($a.data('base-title') || '').replace(/\s*ì íë¨\s*$/g, '').trim(); 1936 var isNewWindowLink = onclickVal.indexOf('fnspecinfodownclick') > -1 1937 || onclickVal.indexOf('window.open') > -1 1938 || $a.attr('target') === '_blank' 1939 || baseTitle.indexOf('ìì°½') > -1; 1940 if(isNewWindowLink){ 1941 $a.attr('title', (baseTitle || 'ìì°½ ì´ë¦¼') + ' ì íë¨'); 1942 }else{ 1943 $a.attr('title', 'ì íë¨'); 1944 } 1945 $('html,body').animate({scrollTop : featureTop || 0}, 300, function(){ 1946 setTimeout(function(){ 1947 toggle(); 1948 //responsiveImage 1949 responsiveImage().init(); 1950 },800); 1951 }); 1952 1953 return false; 1954 }); 1955 //toggle(); 1956 } 1957 1958 /*moduleInit*/ 1959 ($('#replaceBox').length || $('#ftVcArea').length) && moduleInit(); 1960 1961 /* [common] toggle */ 1962 document.querySelector('.tg-slide') && toggle(); 1963 1964 /* [common] tab menu */ 1965 document.querySelector('.common-tab') && commonTab(); 1966 1967 /* [common] bx slide */ 1968 sliderBx(); 1969 1970 /* [common] slick slide */ 1971 sliderSlick(); 1972 1973 /* [common] datepicker */ 1974 datepicker(); 1975 1976 /*ie8 support*/ 1977 if(document.querySelector('.no-canvas') && document.querySelector('.web')){ 1978 //ie8selectbox(); // 0324 1979 //loadScript('/kr/business/asset/js/lib/selectivizr-min.js'); 1980 } 1981 1982 /*ie9 support*/ 1983 if(document.querySelector('.no-textshadow') && document.querySelector('.web')){ 1984 loadScript('/kr/business/asset/js/lib/placeholders.min.js'); 1985 } 1986 1987 /* custom scrollbar */ 1988 actJScrollPane(); 1989 1990 /* gnb2b */ 1991 1992 gnb2b(); // í¼ë¸ë¦¬ì ë¤ì´ html gnb, footer 를 íì¸í ëë gnb2b(); 를 주ìì²ë¦¬íê³ ìë ëì¤ì 주ìì í´ì í©ëë¤. 1993 //if(document.getElementById('headerWrap') == null) { $(document.createElement('div')).load('/html/incl/header.jsp',function(data){ $(document.body).prepend(data); gnb2b(); })} 1994 //if(document.getElementById('footerWrap') == null) { $(document.createElement('div')).load('/html/incl/footer.jsp',function(data){ $(document.body).append(data); /*gnb2b();*/ })}else{gnb2b();} 1995 1996 1997 $(window).on('load', goTop); 1998 1999 /* notiBox */ 2000 $('.noti-box button').each(function(){ 2001 $(this).attr('aria-expanded', 'false') 2002 $(this).attr('aria-label', 'ìì¸ë³´ê¸°') 2003 }) 2004 2005 if($('.noti-box').length){ 2006 $(document).on({ 2007 'click' : function(){ 2008 $(this).toggleClass('rd-plus rd-minus').parent().toggleClass('on') 2009 if($(this).parent().hasClass('on')){ 2010 $(this).attr('aria-expanded', 'false') 2011 }else{ 2012 $(this).attr('aria-expanded', 'true') 2013 } 2014 } 2015 },'.noti-box button'); 2016 } 2017 2018 /* 250401 video caption area */ 2019 videoCaptionArea(); 2020 /* // 250401 video caption area */ 2021}; 2022 2023$( document ).ready(function() { 2024 $('.featureBtns li').each(function() { 2025 if ($(this).hasClass('on')) { 2026 $(this).find('a').attr('title', 'ì íë¨'); 2027 } 2028 }); 2029 $('.common-tab li').each(function() { 2030 var $li = $(this); 2031 var $a = $li.children('a'); 2032 var titles = []; 2033 var baseTitle = $.trim($a.attr('title') || ''); 2034 if (baseTitle) { 2035 titles.push(baseTitle); 2036 } 2037 if ($li.hasClass('selected')) { 2038 /* ì뮬ë ì´ì 모ë°ì¼: íì ë©ë´ê° ìë liì ëë¡ í¸ë¦¬ê±°(a.more)ìë titleì "ì íë¨" 미ë¶ì¬(ìë¸ íë§ ì ì§) */ 2039 var skipSelectedTitle = 2040 typeof setting !== 'undefined' && 2041 setting.mobile && 2042 $li.closest('.responsive.simulation').length > 0 && 2043 $li.children('ul.sub-common-tab').length > 0 && 2044 $li.children('a.more').length > 0; 2045 if (!skipSelectedTitle && baseTitle.indexOf('ì íë¨') === -1) { 2046 titles.push('ì íë¨'); 2047 } 2048 } 2049 if ($a.attr('target') === '_blank') {
2050 if (baseTitle.indexOf('ìì°½') === -1) { 2051 titles.push('ìì°½ì´ë¦¼'); 2052 } 2053 } 2054 $a.attr('title', titles.join(', ')); 2055 }); 2056 $('#headerWrap a[target="_blank"], #footerWrap a[target="_blank"]').each(function () { 2057 var $a = $(this); 2058 var title = $a.attr('title'); 2059 if (!title || $.trim(title) === '') { 2060 $a.attr('title', 'ìì°½ ì´ë¦¼'); 2061 } 2062 }); 2063 $('.top-list .category-info .slide-module-b27 .slick-slide[aria-hidden="false"]').each(function() { 2064 $(this).find('a').attr('tabindex', 0); 2065 }); 2066}); 2067 2068$(function(){ 2069 init(); 2070});
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.