$(document).ready(function () { /* 경기목록/만든경기 등 탭리스트 고정 */ /* $(function () { var headerTop = $('.main_nav').offset().top; $(window).scroll(function () { var scrollTop = $(window).scrollTop(); if (headerTop < scrollTop) { $('.main_nav').addClass('fixed').stop(); } else { $('.main_nav').removeClass('fixed'); } }); }) */ /* 홈 카테고리 버튼클릭 색상 변경 */ $(function () { $('.spo_wrap > a').click(function () { var iMetaSportsType = ($('.spo_cate_btn').find('.e_btn_on').length > 0 ? true : false); if (iMetaSportsType) { $('.spo_wrap a div').removeClass('e_btn_on'); $((this)).children('div').addClass('e_btn_on'); } else { $('.spo_wrap a div').removeClass('btn_on'); $((this)).children('div').addClass('btn_on'); } }); }); // - .find로 e_btn_on 붙어있는걸 모두 찾고 1개 이상이면 아래 if else 함 // (.find와 length>0 을통해 e-sports로 되어 있는지 판단함. html에서 iMetaSportsType ?으로, // Esports인지 아닌지 클릭할때 정해지기 때문에 esports로 클릭해서 바꿨으면 .e_btn_on이 붙어서 // e_btn_on이 무조건 1개 이상이 되므로 E-sports로 판단 ) // if else = e스포츠로 뿌려졌을때 if 아래 부분, 스포츠로 뿌려졌을때 else 아래 부분으로 없애고/붙혀준다는 의미 /* 홈 카테고리 버튼클릭 색상 변경 */ $(function () { $('.sports_cate_my.minimal .spo_wrap > a').click(function () { var iMetaSportsType = ($('.spo_cate_btn').find('.btn_on_title_e').length > 0 ? true : false); if (iMetaSportsType) { $('.spo_wrap a div').removeClass('btn_on_title_e'); $((this)).children('div').addClass('btn_on_title_e'); } else { $('.spo_wrap a div').removeClass('btn_on_title'); $((this)).children('div').addClass('btn_on_title'); } }); }); $(function () { $('.tab_list > li').click(function () { var iMetaSportsType = ($('.tab_list').find('.e_tab_on').length > 0 ? true : false); if (iMetaSportsType) { $('.tab_list li').removeClass('e_tab_on'); $((this)).addClass('e_tab_on'); } else { $('.tab_list li').removeClass('tab_on'); $((this)).addClass('tab_on'); } }); }); /* 카테고리 버튼클릭 색상 변경 */ // $(function () { // $('.spo_wrap > a').click(function () { // var iMetaSportsType = ( $( this ).siblings().find( '.e_btn_on' ).length > 0 ? true : false ); // if ( iMetaSportsType ) // { // $('.spo_wrap a div').removeClass('e_btn_on'); // $((this)).children('div').addClass('e_btn_on'); // } // else // { // $('.spo_wrap a div').removeClass('btn_on'); // $((this)).children('div').addClass('btn_on'); // } // }); // }); /* 카테고리 버튼클릭 색상 변경 */ /* 0522 */ // $(function () { // $('.spo_wrap > a').click(function () { // /* // $((this)).addClass('btn_on_title'); // $((this)).removeClass('btn_on_title'); // */ // $('.spo_wrap a p').removeClass('btn_on_title'); // $((this)).children('p').addClass('btn_on_title'); // }); // }); /* 스포츠 메뉴 스크롤 내리면 최소화 */ //$(window):웹 브라우저 창을 나타냄 //scrollTop():선택한 요소의 스크롤바 수직위치를 받아옴 // $(function () { // var headerTop = $('.sports_cate').offset().top; // $(window).scroll(function () { // var scrollTop = $(window).scrollTop(); // if (headerTop < scrollTop) { // $('.sports_cate').addClass('minimal').stop(); // $((this)).children('spo_wrap > a ').removeClass('btn_on_title').stop(); // $('.spo_wrap').css({ // 'margin-bottom': '0', // }); // $('.community').css({ // 'margin-top': '70px' // }); // $('.sports_cate.minimal').css({ // 'height': '150px' // }); // } else { // $('.sports_cate').removeClass('minimal'); // $('.spo_wrap').css({ // 'margin-bottom': '26px' // }); // $('.spo_name_title').removeClass('btn_on_title'); // $('.community').css({ // 'margin-top': '200px' // }); // $('.sports_cate.minimal').css({ // 'height': '1250px' // }); // } // }); // }) /* 피드글 더보기 */ /* $('.line3_text_wrap').each(function(){ var content = $(this).children('.line_3_text'); var content_txt = content.text(); var content_txt_short = content_txt.substring(0,190)+"..."; //보여줄 길이 + ...함 var btn_more = $('더보기'); $(this).append(btn_more); if(content_txt.length >= 190){ content.html(content_txt_short) }else{ btn_more.hide() } btn_more.click(toggle_content); function toggle_content(){ if($(this).hasClass('short')){ $(this).html('더보기'); content.html(content_txt_short) $(this).removeClass('short'); }else{ $(this).html('접기'); content.html(content_txt); $(this).addClass('short'); } } }); */ /* 튜토리얼 끄기 */ /* $(function () { $("#tutorial_close_start_inter_btn").click(function () { $(".tutorial_box.start_inter_btn").hide(); }); }); */ /* 커뮤니티 탭 */ });