1$(function(){ 2 accessibility(); 3 gnb(); 4 sidebar(); 5 topMove(); 6 pageH1add(); 7 // ìí¼(.short), ì¤ëì¤(.autio) ì¸ë¤ì¼ ë°°ê²½ ë³ê²½ 8 $('.thumb.custom').each(function(){ 9 var imgsrc = $(this).find('img').attr('src'); 10 $(this).css('background', 'url('+imgsrc+')'); 11 }); 12 13 // ìì íì ìì´ì½ 14 15 $('span.text span:contains(ì¬ìë²í¼ì ë르ìë©´ ëììì´ ì¬ìë©ëë¤.)').each(function(){ 16 $(this).html($(this).text().replace('ì¬ìë²í¼ì ë르ìë©´ ëììì´ ì¬ìë©ëë¤.', '')); 17 }); 18 19 $("a[href*='mediaNewsView.do']").find('.thumb').not('.play').addClass('play'); 20 $("a[href*='cateId=good_flash']").find('.thumb').not('.play').addClass('play'); 21 $(".photo_list.short").find('.thumb').not('.play').addClass('play'); 22 23 $("a[href*='https://www.korea.kr/video/index.html']").find('.thumb').not('.play').addClass('play'); 24 25 $(".article.box .as_tab .media").find('.play').removeClass('play'); 26 27 $("a[href*='mediaNewsView.do'].visual_img").not('.play').addClass('play'); 28 $("a[href*='cateId=good_flash'].visual_img").not('.play').addClass('play'); 29 $("a[href*='https://www.korea.kr/video/index.html'].visual_img").not('.play').addClass('play'); 30 31 32 $('.main_news_l a').each(function(){ 33 if($(this).has('.cate').length > 0){ 34 //console.log($(this).find('.cate').attr('data-name')); 35 if($(this).find('.cate').attr('data-name').indexOf('K-ê³µê°') > -1){ 36 $(this).find('.cate').text('K-ê³µê°'); 37 }else if($(this).find('.cate').text().trim().length === 0){ 38 if($(this).attr('href').indexOf('contributePolicyView') > -1){ 39 $(this).find('.cate').text('ì´ìì¸ì¬ì´í¸'); 40 }else if($(this).attr('href').indexOf('cultureColumnView') > -1){ 41 $(this).find('.cate').text('ì ì± ì¹¼ë¼'); 42 }else if($(this).attr('href').indexOf('mediaNewsView') > -1){ 43 $(this).find('.cate').text('ìì'); 44 } 45 } 46 } 47 }); 48 49 50 51 //$(".multimedia .wrap .meslide").find('.thumb.custom.short').not('.play').addClass('play'); 52 53 $('.thumb.play, .visual_img.play').each(function(){ 54 if ($(this).parent().parent().find('.share').length > 0 ){ 55 $(this).prepend('<span class="ico_play pos"><i>ìì</i></span>'); 56 } else { 57 $(this).prepend('<span class="ico_play"><i>ìì</i></span>'); 58 } 59 }); 60 61 /* 62 $(".area_contents .as_side").each(function(){ 63 if ($(this).find('.banner_choice').length == 0){ 64 sidebar(); 65 } 66 }); 67 */ 68 69 // ì´ë¯¸ì§ íë 70 //$('.travel_places_img img').wrap('<span class="zoomImg"></span>'); 71 //$('.travel_img img').wrap('<span class="zoomImg"></span>'); 72 /* 73 $('.view_cont > p img').wrap('<span class="zoomImg"></span>'); 74 $('.cardnews_slider .slider_wrap .slider_for .slides > li img').wrap('<span class="zoomImg"></span>'); 75 */ 76 //.zoomImg, .view_cont .imageWrap figure:not(.left, .right) .imageSpan 77 $('.photoview_slider .slider_wrap .slider_for .slides > li .thumb').zoom({ 78 on:'click', 79 magnify:1.8, 80 callback: function(){ 81 $(this).on('click',function(){ 82 $(this).toggleClass('hover'); 83 }); 84 } 85 }); 86 87 //ê´ë ¨ì¬ì´í¸ 88 $('.rel_btn').on('click',function(){ 89 const t = $(this); 90 if(t.parent().hasClass('active')){ 91 t.attr("title","ê´ë ¨ì¬ì´í¸ ì´ê¸°"); 92 }else{ 93 t.attr("title","ê´ë ¨ì¬ì´í¸ ë«ê¸°"); 94 } 95 t.parent().toggleClass("active"); 96 }); 97 98 //ììì¸ í´ë¦ 99 $(document).on('click',function(e){ 100 if(!$(e.target).parents().hasClass('related_link')){ 101 $('.related_link').removeClass('active').find('button').attr('title','ê´ë ¨ì¬ì´í¸ ì´ê¸°'); 102 } 103 }); 104 105}); 106 107function pageH1add () { 108 109 if($('.content_title .container').length && !$('.content_title .container .breadcrumbs').length){ 110 $('.breadcrumbs').prependTo('.content_title .container'); 111 } 112 113 setTimeout(function (){ 114 var $main = $('#main'); 115 var pageH1 = $.trim($('.breadcrumbs .select button').text()); 116 if (!pageH1) { 117 pageH1 = $.trim($('.breadcrumbs .lst > li > a strong').text()); 118 } 119 if($main.hasClass('sub') && $main.hasClass('view')){ 120 return; 121 } 122 if($main.hasClass('sub') && $main.hasClass('list')){ 123 if ($main.find('.content_title').length || $main.find('.sch_brief').length || $main.find('.focus_top').length && pageH1) { 124 pageH1 += ' 목ë¡'; 125 } else { 126 //pageH1 = 'ëíë¯¼êµ ì ì± ë¸ë¦¬í' 127 } 128 } else if (!pageH1) { 129 pageH1 = 'ëíë¯¼êµ ì ì± ë¸ë¦¬í í' 130 } 131 if (pageH1) { 132 $main.prepend('<h1 class="sr-only">' + pageH1 + '</h1>'); 133 } 134 }, 200); 135 136} 137 138 139function gnb () { 140 var lnbCrt1 = $('.gnb > ul > li:nth-child(' + (lnbDep1) + ')'); 141 var lnbCrt2 = $('.gnb > ul > li:nth-child(' + (lnbDep1) + ') .menu_item > ul > li:nth-child(' + (lnbDep2) + ')'); 142 lnbCrt1.addClass('on'); 143 lnbCrt2.addClass('on'); 144 145 const dep1 = $('.gnb > ul > li'); 146 const dep1_cnt = dep1.length; 147 $('.gnb').addClass('menu_cnt_' + dep1_cnt); 148 149 $('.gnb > ul > li').on('click mouseenter focusin', function(){ 150 $('.header').addClass('menu_on'); 151 $(this).closest(".gnb").addClass('on'); 152 /* $('.gnb > ul > li').removeClass('on'); 153 $(this).addClass('on'); */ 154 }); 155 /* dep1.find(' > a').on('click',function(){ 156 return false;
157 }); */ 158 $('.gnb').on('mouseleave', function(){ 159 $('.header').removeClass('menu_on'); 160 $(this).closest('.gnb').removeClass('on'); 161 /* $(this).find('> li').removeClass('on');*/ 162 lnbCrt1.addClass('on'); 163 lnbCrt2.addClass('on'); 164 }); 165 166 //í¬ì»¤ì¤ ìì ì ë©ë´ ë«ê¸° 167 window.addEventListener("keyup", (e) => { 168 if(!e.target.closest(".gnb")){ 169 $('.header').removeClass('menu_on'); 170 $('.gnb').removeClass('on'); 171 } 172 }) 173 174 //2ì°¨ë©ë´ ìì¹ 175 $('.gnb > ul > li').each(function(index){ 176 const percent = (100 / dep1_cnt); 177 $(this).find('.submenu > div > .menu_item').css({left:(percent * index) + '%'}) 178 }); 179 //2ì°¨ë©ë´ ëì´ê° ê°ì¥í° ê°ì¼ë¡ ì ë¶ ëì´ ë§ì¶ê¸° 180 const h_array = $('.gnb .nav > li .menu_item').map(function(){ 181 return $(this).height(); 182 }).get(); 183 const max_height = Math.max.apply(Math, h_array); 184 $('.gnb .nav > li .menu_item').height(max_height); 185 $('.gnb_bg').height(max_height + 80); 186 187 $('body.main .gnb > ul > li:last-child div > ul > li:last-child').on('keydown', function(e){ 188 if(!e.shiftKey && e.keyCode == 9) $('.gnb > ul > li').removeClass('on'); 189 $('.gnb > ul').removeClass('on'); 190 lnbCrt1.addClass('on'); 191 lnbCrt2.addClass('on'); 192 }); 193 194 $('.gnb ul li div > ul > li').on('mouseenter focusin', function(){ 195 //$(this).closest('ul').find('li').removeClass('on'); 196 $(this).parent().find('li.on').removeClass('on'); 197 198 $(this).addClass('on'); 199 }).on('mouseleave focusout', function(e){ 200 $(this).removeClass('on'); 201 }); 202 $('.gnb > ul > li > a').on('keydown',function(e){ 203 if(e.shiftKey && e.keyCode == 9) { 204 $this = $(this); 205 $this.parent().removeClass('on'); 206 lnbCrt1.addClass('on'); 207 lnbCrt2.addClass('on'); 208 $i = $this.parent().index(); 209 if($i){ 210 $li = $('.gnb > ul > li').eq($i-1); 211 $li.addClass('on'); 212 $li.find('li').last().focus(); 213 } 214 } 215 }); 216 217 //site map 218 $('#header .util .sitemap-open').on('click', function(){ 219 $(this).next('.sitemap_layer').stop().fadeIn(); 220 }); 221 $('#header .sitemap_layer .btn-close').on('click focusout', function() { 222 $(this).parent().parent().stop().fadeOut(); 223 $('#header .sitemap-open').focus(); 224 }); 225 226 //sch detail 227 $('#header .util .sch-open').on('click', function(){ 228 $('#header .util .sch_layer').stop().fadeIn(); 229 }); 230 231 $('#header .util .sch-open-dtl').on('click', function(){ 232 $('#header .util .sch_layer').stop().fadeIn(); 233 $('.dtl_sch_open').addClass('active').next().stop().fadeIn(); 234 $('.dtl_sch_open').find('span').text('ë«ê¸°'); 235 }); 236 237 $('#header .sch_layer .btn-close').on('click focusout', function() { 238 $(this).parent().parent().fadeOut(); 239 $('.dtl_sch_wrap').stop().fadeOut(); 240 $('.dtl_sch_open').removeClass('active'); 241 $('.dtl_sch_open').find('span').text('ì´ê¸°'); 242 $('.sch-open-dtl').focus(); 243 }); 244 245 $('#header .sch_layer #hsch_topSearchKeyword').on('input', function() { 246 if($('#header .sch_layer #hsch_topSearchKeyword').val() ==''){ 247 $('#header .sch_layer .clear_input').css('display', 'none'); 248 }else{ 249 $('#header .sch_layer .clear_input').css('display', 'block'); 250 } 251 }); 252 253 $('#header .sch_layer .clear_input').on('click', function() { 254 $(this).css('display', 'none'); 255 $('#header .sch_layer .sch input').focus(); 256 }); 257 258 $('.dtl_sch_open').on('click', function(){ 259 if($(this).hasClass('active')){ 260 $(this).removeClass('active').next().stop().fadeOut(); 261 $(this).find('span').text('ì´ê¸°'); 262 }else{ 263 $(this).addClass('active').next().stop().fadeIn(); 264 $(this).find('span').text('ë«ê¸°'); 265 } 266 }); 267 268 $('.dtl_sch_close').on('click focusout', function(){ 269 $(this).parent('.dtl_sch_wrap').fadeOut(); 270 $('.dtl_sch_open').focus(); 271 $('.dtl_sch_open').removeClass('active'); 272 $('.dtl_sch_open').find('span').text('ì´ê¸°'); 273 }); 274 275 $('.dtl_sch_post .sbtn').on('click', function(){ 276 if($(this).hasClass('close')){ 277 $(this).removeClass('close'); 278 $(this).parent().parent().removeClass('active'); 279 $(this).find('span i').text('í¼ì¹ê¸°'); 280 $(this).parent().next('ul').hide(); 281 }else{ 282 $(this).addClass('close'); 283 $(this).parent().parent().addClass('active'); 284 $(this).find('span i').text('ì 기'); 285 $(this).parent().next('ul').show(); 286 } 287 }); 288 289}; 290
291function topMove () { 292 293 $('.go_top').on('click', function() { 294 $('html, body').animate({scrollTop : 0}, 100); 295 $('body').focus(); 296 }); 297 $(window).on('scroll', function() { 298 if($(window).scrollTop() > 430){ 299 $('.go_top').addClass('active'); 300 }else{ 301 $('.go_top').removeClass('active'); 302 } 303 }); 304 305}; 306 307function fullBanner () { 308 309 $('.full_banner .container .close').on('click', function() { 310 $('.full_banner').stop().animate({'margin-top':-122+'px'}, 150); //122 311 $('body').removeClass('full_banner_yes'); 312 $('.full_banner .open').show(); 313 }); 314 315 $('.full_banner .open').on('click', function() { 316 $('.full_banner').stop().animate({'margin-top':0+'px'}, 150); 317 $('body').addClass('full_banner_yes'); 318 $('.full_banner .open').hide(); 319 $(".full_banner").attr('tabindex', '-1').focus(); 320 }); 321 322}; 323 324function fixed () { 325 326 if($('body:not(.main)').hasClass("full_banner_yes")){ 327 if($(window).scrollTop()>338){ 328 $('body:not(.main) .header').addClass('fixed'); 329 $('body:not(.main) main.sub').css('margin-top','161px'); 330 $('body:not(.main) .layer_popup').css('top','110px'); 331 }else{ 332 $('body:not(.main) .header').removeClass('fixed'); 333 $('body:not(.main) main.sub').removeAttr('style'); 334 $('body:not(.main) .layer_popup').removeAttr('style'); 335 } 336 }else{ 337 if($(window).scrollTop()>338){ 338 $('body:not(.main) .header').addClass('fixed'); 339 $('body:not(.main) main.sub').css('margin-top','161px'); 340 }else{ 341 $('body:not(.main) .header').removeClass('fixed'); 342 $('body:not(.main) main.sub').removeAttr('style'); 343 } 344 } 345 346}; 347 348 349function accessibility () { 350 351 //íµí©ê²ìì°½ íìê²ìì¡°ê±´ ì´ê¸° 352 $('.sch_layer .dtl_sch_post input').on('click', function(){ 353 const data = $(this).data('target'); 354 $(this).closest('li').find('.period_free_date').removeClass('active'); 355 $('.' + data).addClass('active'); 356 }); 357 358 359 $('img[usemap]').rwdImageMaps(); //ì´ë¯¸ì§ë§µ 360 $('a[target="_blank"]').attr('title','ìì°½ì¼ë¡ ì´ë¦¼'); 361 $('[class*="xi-"], [class*="xe-"]').attr('aria-hidden','true'); //ìì´ì½í°í¸ ì¤í¬ë¦°ë¦¬ëê° ì½ì§ 못íëë¡ íë ìì± 362 //$('#lnb').attr('tabindex', '-1'); 363 $('#nav').attr('tabindex', '-1'); 364 $('#main').attr('tabindex', '-1'); 365 $('body').attr('tabindex', '-1'); 366 $('.tabs_common li.active button, .tabs_common li.active a, .sort-post ul.sort li.active button, .tabs_text li.active a').attr('title','ì íë¨'); 367 $('.as_side .policy_home .menu ul li.on a').attr('title','ì íë¨'); 368 $('.sch_post.expert .tab_nav li.active > a').attr('title','ì íë¨'); 369 $('.sch_post.photo .tab_nav li.active > a').attr('title','ì íë¨'); 370 $('.area_contents .as_side .focus_menu .keywords li.on a').attr('title','ì íë¨'); 371 $('.area_contents .as_side .audio_menu .keywords li.on a').attr('title','ì íë¨'); 372 373 /* 본문ë£ê¸° */ 374 $('.tts').on('click', function() { 375 if($(this).hasClass('active')){ 376 $(this).removeClass('active'); 377 $(this).find('span').text('ìì'); 378 }else{ 379 $(this).addClass('active'); 380 $(this).find('span').text('ë©ì¶ê¸°'); 381 } 382 }); 383 384 function showTtsEndNotice($wrap) { 385 var $notice = $wrap.find('.tts_notice'); 386 if (!$notice.length) return; 387 $notice.stop(true, true) 388 .fadeIn(200) 389 .delay(800) 390 .fadeOut(600); 391 } 392 393 394 $('.tts_speed .tts_lst li.active > button').attr('title','ì íë¨'); 395 $('.tts_speed .tts_lst ul li button').on('click', function () { 396 $(this).closest('li').addClass('active').siblings().removeClass('active'); 397 $('.tts_speed .tts_lst ul li button').removeAttr('title'); 398 $(this).attr('title', 'ì íë¨'); 399 }); 400 401 $('.tts_speed .start').on('click', function () { 402 var $wrap = $(this).closest('.tts_speed'); 403 $wrap.addClass('active'); 404 $wrap.find('.open span').text('ë©ì¶ê¸°'); 405 $(this).closest('.tts_lst').stop(true, true).fadeOut(150); 406 }); 407 408 $('.tts_speed .tts_lst .close').on('click', function () { 409 var $wrap = $(this).closest('.tts_speed'); 410 $(this).closest('.tts_lst').stop(true, true).fadeOut(150); 411 $wrap.find('.open span').text('ì´ê¸°'); 412 $wrap.find('.open').focus(); 413 }); 414 415 416 417 var nowZoom = 1.25; 418 var maxZoom = 2; 419 var mimZoom = 0.5; 420 $('.tool .plus').on('click', function() { 421 //console.log(nowZoom); 422 if(nowZoom < maxZoom){ 423 nowZoom += 0.0625; 424 $('.editor_note, .article_body .view_cont').css('font-size', + nowZoom + 'rem'); 425 } 426 }); 427 $('.tool .minus').on('click', function() { 428 //console.log(nowZoom); 429 if(nowZoom > mimZoom){ 430 nowZoom -= 0.0625; 431 $('.editor_note, .article_body .view_cont').css('font-size', + nowZoom + 'rem'); 432 } 433 }); 434 435 $('.font_size .size_lst li.active > button').attr('title','ì íë¨'); 436 $('.font_size .size_lst ul li button').on('click', function() { 437 $(this).attr('title','ì íë¨').parent().addClass('active').siblings().removeClass('active').children('button').removeAttr('title'); 438 var font_size = 20; 439 if($(this).hasClass("ftsize1")) font_size = 18; 440 else if($(this).hasClass("ftsize2")) font_size = 20; 441 else if($(this).hasClass("ftsize3")) font_size = 23; 442 else if($(this).hasClass("ftsize4")) font_size = 24; 443 else if($(this).hasClass("ftsize5")) font_size = 25; 444 $('.article_body .view_cont').css("font-size",font_size+"px"); 445 }); 446
447 $('.font_size .open').on('click', function() { 448 if($(this).find('span').text() == 'ê¸ìí¬ê¸° ì¤ì ì´ê¸°' ){ 449 $(this).next('.size_lst').stop().fadeIn(150); 450 $(this).find('span').text('ê¸ìí¬ê¸° ì¤ì ë«ê¸°'); 451 }else{ 452 $(this).find('span').text('ê¸ìí¬ê¸° ì¤ì ì´ê¸°'); 453 $(this).next('.size_lst').stop().fadeOut(150); 454 } 455 }); 456 457 $('.font_size .size_lst .close').on('click focusout', function() { 458 $(this).parent('.font_size .size_lst').stop().fadeOut(150); 459 $('.font_size .open span').text('ê¸ìí¬ê¸° ì¤ì ì´ê¸°'); 460 $('.font_size .open').focus(); 461 }); 462 463 if($('.font_size').length > 0){ 464 $(document).on('click', function(e) { 465 if(!$('.font_size').is(e.target) && $('.font_size').has(e.target).length === 0){ 466 $('.font_size .open span').text('ê¸ìí¬ê¸° ì¤ì ì´ê¸°'); 467 $('.font_size .size_lst').stop().fadeOut(150); 468 } 469 }); 470 } 471 472 /* 2023.08.24 ìì 473 $('table').each(function(){ 474 var tableTitle = $(this).attr('summary'); 475 if ($(this).find('caption').length > 0){ 476 $(this).find('caption').append(tableTitle); 477 } else { 478 $(this).prepend('<caption>' + tableTitle + '</caption>'); 479 } 480 $(this).removeAttr('summary'); 481 }); 482 */ 483 484 $('.imageWrap').each(function(){ 485 if ($(this).find('.captions b, .captions strong').text().length <= 1){ 486 $(this).find('.captions').remove(); 487 } 488 }); 489 490 $('main.sub.view .area_contents .article_wrap .article_head').each(function(){ 491 if (!$(this).find('h2').length){ 492 $(this).prepend('<h2 class="sr-only">ì½í ì¸ ë´ì©</h2>'); 493 } 494 }); 495 496}; 497 498function sidebar () { 499 500 var top_last_scroll = 0; 501 var diff_scroll = 0; 502 function onScrollDirection() { 503 var function_direction = function () { 504 var top_scroll = $(document).scrollTop(); 505 window.diff_scroll = top_scroll - window.top_last_scroll; 506 window.top_last_scroll = top_scroll; 507 $(window).trigger('onScrollAdjustEndLine'); 508 }; 509 $(window).scroll(function_direction); 510 $(window).resize(function_direction); 511 setTimeout(function () { 512 window.diff_scroll = -1; 513 $(window).trigger('onScrollAdjustEndLine'); 514 }, 200); 515 } 516 function onScrollAdjustEndLine(query_start, query_end, query_in) { 517 $(window).on('onScrollAdjustEndLine', function () { 518 var obj_start = $(query_start); 519 var obj_end = $(query_end); 520 var obj_in = $(query_in); 521 if (obj_start && obj_end && obj_in) { 522 var top_in = obj_in.offset().top; 523 var top_win = $(document).scrollTop(); 524 var top_start = obj_start.offset().top; 525 var top_end = obj_end.offset().top; 526 var left_start = obj_start.offset().left - $(window).scrollLeft(); 527 var width_start = obj_start.width(); 528 var height_win = $(window).innerHeight(); 529 var height_end = obj_end.height(); 530 var height_in = obj_in.height(); 531 var bot_win = top_win + height_win; 532 var bot_end = top_end + height_end; 533 var bot_in = top_in + height_in; 534 var gap_max = top_end + height_end - top_start - height_in; 535 536 var hight_header = $('.header').outerHeight(true) + 25; 537 var hight_area_page = $('.area_page').outerHeight(true) + 15; 538 var hight_area_audio = $('.area_audio_player').outerHeight(true) + 15; 539 var hight_area_banner = $('.area_banner').outerHeight(true); 540 541 obj_start.css({ height: height_in + 'px' }); 542 if (window.diff_scroll == 0) { 543 if (obj_in.css('position') == 'fixed') { 544 obj_in.css({ left: left_start + 'px' }); 545 } 546 } 547 if (height_in >= bot_end - top_start) { 548 obj_in.css({ position: 'relative', top: '0px', left: '0px', width: '' }); 549 } else if (height_win > top_end + height_end - top_start) { 550 obj_in.css({ position: 'relative', top: '0px', left: '0px', width: '' }); 551 } else if (height_win - hight_header /*- hight_area_page*/ /*- hight_area_audio*/ > height_in) { 552 553 if (top_start >= top_win) { 554 obj_in.css({ position: 'relative', top: '0px', left: '0px', width: '' }); 555 } else if (top_start + gap_max <= top_win) { 556 obj_in.css({ position: 'relative', top: gap_max + 'px', left: '0px', width: ''}); 557 } else { 558 obj_in.css({position: 'fixed', top: hight_header + 'px', left: left_start + 'px', width: width_start + 'px'}); 559 } 560 561 } else { 562 if (window.diff_scroll < 0) { 563 if (top_start >= top_win) { 564 obj_in.css({position: 'relative', top: '0px', left: '0px', width: ''}); 565 } else if (top_in >= top_win) { 566 obj_in.css({position: 'fixed', top: hight_header + 'px', left: left_start + 'px', width: width_start + 'px'}); 567 } else if (obj_in.attr('data-direction') == 'down' && obj_in.css('position') == 'fixed') { 568 obj_in.css({position: 'relative', top: (top_in - top_start - diff_scroll) + 'px', left: '0px', width: ''}); 569 } 570 obj_in.attr('data-direction', 'up'); 571 } 572 if (window.diff_scroll > 0) { 573 if (bot_end <= bot_win) { 574 obj_in.css({position: 'relative', top: gap_max + 'px', left: '0px', width: ''}); 575 } else if (bot_in <= bot_win ) { 576 obj_in.css({position: 'fixed', top: height_win - height_in + 'px', left: left_start + 'px', width: width_start + 'px'}) 577 } else if (obj_in.attr('data-direction') == 'up' && obj_in.css('position') == 'fixed') { 578 obj_in.css({position: 'relative', top: top_in - top_start - diff_scroll + 'px', left: '0px', width: ''}); 579 } 580 obj_in.attr('data-direction', 'down'); 581 } 582 } 583 } 584 }); 585 } 586 587 function onScrollWork () { 588 var thisTarget = $('main.sub'); 589 /* 590 if (thisTarget.find('.article_top').length > 0){ 591 $('.as_sns').css({ top: $('.article_top').outerHeight() + 40 + 'px'}); 592 } else { 593 $('.as_sns').removeAttr('style'); 594 } 595 */ 596 597 if (thisTarget.find('.as_sns').length > 0){ 598 onScrollAdjustEndLine('.as_sns .scroll_start', '.area_contents', '.as_sns .scroll_in'); 599 //$('main.sub.list .area_contents .as_sns').css('margin-left','-81px'); 600 if (thisTarget.find('.livere_box').length > 0){ 601 $('.as_sns .comment').parent('li').show(); 602 } else { 603 $('.as_sns .comment').parent('li').hide(); 604 } 605 }else{ 606 $('main.sub.list .area_contents .as_sns').css('margin-left','0'); 607 } 608 if (thisTarget.find('.as_side').length > 0){ 609 onScrollAdjustEndLine('.as_side .scroll_start', '.area_contents', '.as_side .scroll_in'); 610 }else{ 611 $('main.sub .area_contents .article_wrap, main.sub .area_contents .article_wrap .container').css('width','100%'); 612 } 613 614 //ì¢ì¸¡ ê³µì , ì¢ìì, ëê¸ ë²í¼ ëì´ 615 if($('main.view .as_sns').length){ // ìì¸íì´ì§ 616 const v_top = $('.variety').position().top + ($('.variety').outerHeight(true) - $('.variety').innerHeight()) + $('.view_title').outerHeight(true); 617 $('.as_sns').css({'padding-top':v_top}); 618 //console.log(v_top); 619 } 620 if($('main.list .as_sns').length){ // 리ì¤í¸ íì´ì§ 621 const q_top = $('.breadcrumbs').outerHeight(true) /*+ $('.view_title').outerHeight(true)*/; 622 $('.as_sns').css({'padding-top':q_top}); 623 //console.log(q_top); 624 } 625 } 626 627 $('.as_side').contents().wrapAll('<div class="scroll_start"><div class="scroll_in"></div></div>'); 628 $('.as_sns').contents().wrapAll('<div class="scroll_start"><div class="scroll_in"></div></div>'); 629 onScrollDirection(); 630 631 onScrollWork(); 632 633 $('.livere_comment button').on('click', function(){ 634 onScrollDirection(); 635 }); 636 637 $('.as_side .article button, .as_side .article a').on('mousedown', function(e){ 638 e.preventDefault(); 639 }).on('focusin', function(){ 640 $('html, body').animate({scrollTop : $(this).offset().top - 300}, 100); 641 }); 642 643 644 /* 645 $(window).on("scroll load resize", function() { 646 var winScroll = $(window).scrollTop(); 647 var asideScroll = $('.as_side .scroll-in').attr('data-direction'); 648 if( asideScroll === 'up'){ 649 console.log('up'); 650 $('.as_side .scroll-in').css('padding-top',''); 651 if( winScroll < 390){ 652 $('.as_side .scroll-in').css('padding-top',''); 653 } 654 }else if( asideScroll === 'down'){ 655 console.log('down'); 656 $('.as_side .scroll-in').css('padding-top',''); 657 } 658 }); 659 */ 660 661 //ì ìì± ìë¨ íë©ë´ ì ê·¼ì± 662 $('.category_lst li').each(function(){ 663 const t = $(this); 664 665 if(t.hasClass('active')){ 666 t.find('a').attr('title','ì íë¨'); 667 } 668 }); 669 670 $(window).on("load resize", function() { 671 onScrollDirection(); 672 }); 673 674 $(window).on("load", function() { 675 fullBanner(); 676 onScrollWork(); 677 }); 678 679 $(window).on("load scroll", function() { 680 fixed(); 681 }); 682}; 683
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.