/*jslint browser: true*/ /*global $, jQuery*/ $(function () { /*이미지 슬라이드...*/ $('.carousel-inner .item').carousel({ pause: "hover", wrap: true, keyboard: true }); //햄버거 메뉴 // $(".ruby-menu-right .three").click(function () { $("html,body").addClass('hidden_scroll'); $('.all_menu').stop().slideDown(); }); $('.all_menu .close_button').click(function () { $('.all_menu').stop().fadeOut(); $("html,body").removeClass('hidden_scroll'); }) // /* 상단고정 */ var gnb = $('.gnb'); var gnbHeight = gnb.height(); $(window).on('scroll', function() { var banner = $('#banner_bottom'); var footerOffset = $('#General_Inquiries').offset().top; var scrollPosition = $(window).scrollTop(); var scrollThreshold = 200; console.log(footerOffset + "/" + $(window).scrollTop()) if (scrollPosition >= (footerOffset - scrollThreshold) ) { banner.hide(); } else { banner.show(); } if (scrollPosition > gnbHeight - 10) { $('.scrollToTop').stop().fadeIn(); } else { $('.scrollToTop').stop().fadeOut(); } }); // function scrollFixed() { // if ($(this).scrollTop() > gnbHeight - 10) { // gnb.addClass('on'); // gnb.find('.mainmenu').addClass('on'); // $('.nt_sitemap').addClass('on'); // // } else { // gnb.removeClass('on'); // gnb.find('.mainmenu').removeClass('on'); // $('.nt_sitemap').removeClass('on'); // // } // } // scrollFixed(); /* 네비게이션 분류 */ //모바일 $('.m_menu .s_menu_li').mouseenter(function () { let m_menu_index = $(this).index(); $('.m_menu_list .list_box').eq(m_menu_index).addClass('active'); $('.m_menu_list .list_box').not($('.m_menu_list .list_box').eq(m_menu_index)).removeClass('active'); }) //네브 클릭 이벤트 $('.ruby-menu >li').click(function(){ $(this).addClass('visible'); // $('.visible >div >ul> li').click(function(){ // $(this).addClass('ruby-active-menu-item'); // $('.ruby-active-menu-item .ruby-active-menu-item').stop().show(); // $('.visible >div >ul> li').not(this).removeClass('ruby-active-menu-item'); // }) $(".ruby-menu >li").not(this).removeClass('visible'); }) $('.ruby-menu-header').mouseleave(function(){ $('.ruby-menu >li').removeClass('visible'); }) //스크롤 탑 $('.scrollToTop').click(function () { $('html, body').animate({ scrollTop: 0 }, 800); return false; }); //neb 페이지 상단 글자 애니메이션 $(function () { $('.intro').addClass('go'); $('.reload').click(function () { $('.intro').removeClass('go').delay(200).queue(function (next) { $('.intro').addClass('go'); next(); }); }); }) //neb 샘플 아이콘 $(window).on('scroll', function () { if ($(window).scrollTop() > 200) { $('.seminar_request').addClass("on"); } else if ($(window).scrollTop() > 3955 || $(window).scrollTop() < 199) { $('.seminar_request').removeClass("on"); } }) /*creoptix reference*/ $('#detail .creoptix .btn').click(function () { let has_refe = $('.refe_g').hasClass('show'); if (has_refe) { $('.refe_g').removeClass('show'); } else if (!has_refe) { $('.refe_g').addClass('show'); } }) $('#detail .denovix .btn').click(function () { let has_info = $('.moreinfo').hasClass('show'); if (has_info) { $('.moreinfo').removeClass('show'); } else if (!has_info) { $('.moreinfo').addClass('show'); } }) /**/ // $('.logoArea p').click(function () { // $(this).toggleClass('on'); // // if ($(this).hasClass('on')) { // $('.mainmenu').slideDown(); // } else { // $('.mainmenu').slideUp(); // } // }); /* 서브페이지 이동 */ function sub_m() { let fix_b = $("#sticky .st_list li a"); let fix_nav = $("#header .gnb.on").height(); $(fix_b).click(function () { const scr_move = $($(this).attr("data-target")).offset().top; $("body,html").animate({ scrollTop: scr_move - fix_nav }, 500); }) } function detail_tab() { // 제품 상세 탭 let sticky_tab = $('#detail div .content').hasClass('service'); if (sticky_tab) { $('.sticky .off').stop().hide(); $('.sticky .on').stop().show(); } else if (!sticky_tab) { $('.sticky .off').stop().show(); $('.sticky .on').stop().hide(); } }; function tab_num() { let non_spec = $('.content').hasClass('nospec'); let non_rel = $('.content').hasClass('norel'); if (non_spec) { $('.sticky .st_list').addClass('no_spec'); } if (non_rel) { $('.sticky .st_list').addClass('no_rel'); } else { $('.sticky .st_list').removeClass('no_spec'); $('.sticky .st_list').removeClass('no_rel'); } }; /////////////////////// NEB 셀렉트 //////////////////// /////////////////////////////////////////////////////////// /**/ $('.n_swap').each(function () { var $this = $(this); $this.bind('mouseenter', function () { var srcArr = $(this).attr('src').split('.'); $(this).attr('src', srcArr[0] + '_on.' + srcArr[1]); $(this).addClass('on'); }).bind('mouseleave', function () { $(this).attr('src', $(this).attr('src').replace('_on', '')); $(this).removeClass('on'); }); }); /* 툴팁 */ $(function () { $('[data-toggle="tooltip"]').tooltip(); }); /* 이미지 확대,축소 */ // $('.scaleUp').on({ // mouseover: function () { // $(this).addClass('on'); // }, // mouseout: function () { // $(this).removeClass('on'); // } // }); // $('.scaleDown').on({ // mouseover: function () { // $(this).addClass('on'); // }, // mouseout: function () { // $(this).removeClass('on'); // } // }); /* 효과01 */ $('.effect01').each(function () { $(this).on({ mouseenter: function () { $(this).find('.effect01-box').stop().animate({ bottom: 0, opacity: 1 }, 200); }, mouseleave: function () { $(this).find('.effect01-box').stop().animate({ bottom: -50, opacity: 0 }, 200); } }); $(this).css({ cursor: 'pointer' }); }); /* 효과02 */ $('.effect02').each(function () { $(this).on({ mouseenter: function () { $('.effect02-box').stop().animate({ top: 20, opacity: 0.2 }, 100); $(this).find('.effect02-box').stop().animate({ top: 0, opacity: 1.0 }, 200); }, mouseleave: function () { $('.effect02-box').stop().animate({ top: 10, opacity: 0.8 }, 100); $(this).find('.effect02-box').stop().animate({ top: 10, opacity: 0.8 }, 200); } }); $(this).css({ cursor: 'pointer' }); }); /* 효과03 */ $('.effect03').each(function () { $(this).on({ mouseenter: function () { $(this).find('.effect03-box').stop().animate({ top: '50%', opacity: 1 }, 200); }, mouseleave: function () { $(this).find('.effect03-box').stop().animate({ top: '40%', opacity: 0 }, 200); } }); $(this).css({ cursor: 'pointer' }); }); /* map 지도 : 구글지도 */ $('.map_google').click(function () { $(this).find('iframe').addClass('clicked'); }).mouseleave(function () { $(this).find('iframe').removeClass('clicked'); }); /************************************************************ 게시판 ************************************************************/ /*게시판:공통*/ $('.n_board_txt, .n_board_gallery').find('table[border="1"]').attr('border', '0'); /* 카테고리 > 셀렉트박스 : 속성 변경 ****************************************/ $('form[name=com_board_form]').parent().addClass('categoryArea'); $('form[name=com_board_form]').parent().find('td').removeAttr('align'); // $('form[name=com_board_form]').parent().css('marginBottom', '5px'); // $('form[name=com_board_form]').parent().find('img').remove(); // $('form[name=com_board_form]').parent().find('td > b').remove(); /* 카테고리 > 탭버튼형 : 속성 변경(폰트크기) */ $('.sul_menu').parent('td').find('font').removeAttr('style', ''); /* 댓글영역 ***********************************************/ /* 댓글영역 : 작성 */ $('.board_comment_bgcolor tbody:not(:first-child)').css({ 'border': '0px solid #f00', 'padding': '0 10px', 'display': 'block' }); /* 댓글영역 : 작성영역 */ $('.comment_txt > textarea').css({ 'margin': '0 0 5px', 'padding': '10px', 'border': '1px solid #ccc', 'height': '100px' }); /* 댓글영역 : 작성영역 : 버튼(댓글달기) */ $('.comment_txt > input[type=image]').css({ 'paddingRight': '10px', 'float': 'left' }); /* 댓글영역 : 댓글목록 */ $('.comment_name').parent('tr').children('td').removeAttr('width'); $('.comment_name').parent('tr').children('td:nth-child(2)').addClass('comment_view'); $('.comment_name').parent('tr').children('td:nth-child(3)').addClass('comment_hour'); /* 댓글영역 : 댓글목록 */ $('.comment_name').parent().parent().parent().parent().parent().parent().parent().addClass('commentArea'); /* 텍스트형 : 글목록 : 최상단 라인영역 */ $('.n_board_txt .bbsno').parents('table').prev().find('td').addClass('board_top_line'); /* 텍스트형 : 글목록 'tr' 선택*/ $('.n_board_txt .bbsno').parent('tr').addClass('tr_line'); /* 텍스트형 : 글목록 : 최상단 구분영역 */ $('.n_board_txt .att_title').parent('tr').addClass('boardTitBar'); /* 텍스트형 : 글목록 : 최상단 행 속성 */ $('.n_board_txt .att_title font').removeAttr('style'); /* 텍스트형, 갤러리형, 웹진형 : 글보기 / 글쓰기*/ $('.n_board_txt .board_bgcolor, .n_board_gallery .board_bgcolor, .n_board_webzine .board_bgcolor').parent('tr').addClass('diviedLine'); /* 텍스트형 : 목록전체영역 : 하단여백*/ $('.boardTitBar').parent().parent().css('marginBottom', '20px'); /* 공통 : 목록 : 하단 영역들 */ $('.paging').css('padding', '10px 0'); $('.paging').parent().parent().parent().prev().css('border', '1px solid #fff'); $('.paging').parent('tr').next().remove(); // 갤러리목록 : 관리자로그인시 게시물체크박스 $('.n_board_gallery').find('input[name=delete_check_notice\\[\\]]').parent('td').addClass('adminCheck'); $('.n_board_gallery').find('input[name=delete_check_notice\\[\\]]').addClass('adminCheckBox'); // 갤러리목록 : 이미지선택(제목을 사용해야 됨) $('.gallery_subject').parent().siblings('tr:first-child').addClass('nSize'); // 갤러리목록 : 사이즈 $('.nSize').parents('.bbsnewf5').parents('td').addClass('boxArea'); // 텍스트 내용 $('.gallery_etc').css('color', '#fff'); /* 폼메일 : 항목의 속성 제거 ***********************************************/ $('.formmail_title_bgcolor font').removeAttr('style'); /* 개인정보 수집동의 영역 */ $('.np_form input[name=com_formmail_check_safe]').closest('table').addClass('personalInformation'); /* 스팸등록방지 영역 */ $('#captcha').closest('tr').addClass('captcha'); /* 폼메일 : 하단버튼영역 : 상단여백 */ $('a[href="javascript: document.com_formmail.reset();"]').parent().addClass('formButton'); /* 폼메일 : 하단버튼영역 : 버튼 : 확인 */ $('.formButton a:first-child img').attr('src', '../img/component/board/board_1/confirm.gif'); /* 폼메일 : 하단버튼영역 : 버튼 : 취소 */ $('.formButton a:last-child img').attr('src', '../img/component/board/board_1/cancel.gif'); $(".formmail_cell_bgcolor textarea[name=description1]").attr("placeholder", "원하시는 주제와 간단한 소속 및 정보를 남겨주시면 빠른 답변 드리겠습니다."); $("#sample_table .formmail_cell_bgcolor textarea[name=description1]").attr("placeholder", "샘플 이름 또는 카탈로그 넘버를 적어주시면 빠른 회신 드리겠습니다."); $('.formmail_cell_bgcolor input[name=captcha_code]').focusout(function () { $('.ballon').removeClass('on'); }) $('.formmail_cell_bgcolor input[name=captcha_code]').focusin(function () { $('.ballon').addClass('on'); }) /* 글쓰기 : 하단버튼영역의 상단여백 */ $('a[href="javascript: document.com_board.reset()"]').parent().parent().parent().parent().addClass('nbButton'); $('a[href="javascript: history.back()"]').parent().parent().parent().parent().addClass('nbButton'); /* 글보기 : 하단버튼영역 */ $('img[align=absmiddle]').closest('table').parent().parent().parent().parent().addClass('veiwBottonArea'); /* 글보기 : 하단라인 & 글목록리스트 */ $('.veiwBottonArea').siblings('table:last').find('td').css('backgroundColor', '#fff'); /* 글보기 : 하단 버튼 */ $('img[src="/cimg/btn_sdel.gif"]').attr('src', '../img/component/board/board_1/admin_delete.gif'); $('img[src="/cimg/move.gif"]').attr('src', '../img/component/board/board_1/admin_move.gif'); $('img[src="/cimg/copy.gif"]').attr('src', '../img/component/board/board_1/admin_copy.gif'); /***************************************************************** 일정관리 *****************************************************************/ $('.np_schedule table').attr('width', '100%'); $('.np_schedule').find('input[name=subject]').attr('size', '').css('width', '100%'); /***************************************************************** 쇼핑몰 : 페이징 *****************************************************************/ $('.tb_font04').parent().siblings('td[width=1]').remove(); /***************************************************************** 폼메일 공백제거 *****************************************************************/ // $('.np_form td').each(function () { // $(this).html($(this).html().replace(/ /gi, '')); // }); /***************************************************************** 폼메일 onclick *****************************************************************/ /*$("#formCheck").click(function(){ alert("세미나를 신청해 주셔서 감사합니다"); });*/ /***************************************************************** Animations *****************************************************************/ var contentWayPoint = function () { $('.animate-box').waypoint(function (direction) { if (direction === 'down' && !$(this.element).hasClass('animatedFast')) { $(this.element).addClass('item-animate'); setTimeout(function () { $('body .animate-box.item-animate').each(function (k) { var el = $(this); setTimeout(function () { var effect = el.data('animate-effect'); if (effect === 'fadeInUp') { el.addClass('fadeInUp animatedFast'); } else if (effect === 'fadeInLeft') { el.addClass('fadeInLeft animatedFast'); } else if (effect === 'fadeInRight') { el.addClass('fadeInRight animatedFast'); } else if (effect === 'fadeInDown') { el.addClass('fadeInDown animatedFast'); } else { el.addClass('fadeInUp animatedFast'); } el.removeClass('item-animate'); }, k * 300, 'easeInOutExpo'); }); }, 80); } }, { offset: '95%' }); }; $(function () { contentWayPoint(); sub_m(); detail_tab(); tab_num(); }); /*$('.bx_center').click(function(){ $('.result_product').addClass('.result_on'); $(this).removeClass('.result_on'); });*/ });