// URL ÆÄ¶ó¹ÌÅÍ¿¡¼­ tm, sm °ª °¡Á®¿À±â function getUrlParameter(name) { name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'); var results = regex.exec(location.search); return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' ')); } jQuery(function($){ // ½ºÅ©·Ñ ³»¸±¶§ ÄÁÅÙÃ÷ º¸À̱â $(window).on('scroll',function(){ var T = $(this).scrollTop(); var H = $(this).height(); $('.ready').each(function(){ var obj_T = $(this).offset().top; var X = obj_T < T + H / 1.5; if (X) $(this).removeClass('ready'); }); }).scroll(); $(document).ready(function(){ // -------------------------------- // 1. ÇöÀç ÆäÀÌÁöÀÇ tm, sm °ª °¡Á®¿À±â // -------------------------------- var tm = getUrlParameter('tm'); // depth1 var sm = getUrlParameter('sm'); // depth2 // -------------------------------- // 2. Çì´õ ´ë¸Þ´º(on/open) Ȱ¼ºÈ­ // -------------------------------- if (tm) { var dep1Index = parseInt(tm, 10) - 1; var $dep1 = $('#lnb .lnb > li'); // ±âÁ¸ on/open Á¦°Å $dep1.removeClass('on open'); // ÇöÀç depth1¿¡ on + open Ãß°¡ if (dep1Index >= 0 && dep1Index < $dep1.length) { $dep1.eq(dep1Index).addClass('on open'); } } // -------------------------------- // 3. ¼­ºê¸Þ´º(on) Ȱ¼ºÈ­ // -------------------------------- if (sm) { var $subLi = $('#lnb .lnb .subnav li'); var $targetA; // ±âÁ¸ on Á¦°Å $subLi.removeClass('on'); if (tm) { // tm, sm µÑ ´Ù ¸Â´Â ¸µÅ©¸¦ ¿ì¼± °Ë»ö $targetA = $('#lnb .lnb a[href*="tm=' + tm + '&sm=' + sm + '"]'); } else { // tmÀÌ ¾øÀ¸¸é sm¸¸À¸·Î ¸ÅĪ (¿¹ºñ¿ë) $targetA = $('#lnb .lnb a[href*="sm=' + sm + '"]'); } $targetA.parent('li').addClass('on'); } // -------------------------------- // 4. Á¦Ç°¼Ò°³ ÅÇ(.tab_list / .tab_cont) tm, sm ±âÁØ ÀÚµ¿ Ȱ¼ºÈ­ // tm = 4 (Á¦Ç°¼Ò°³) // sm : 2=ºäƼµð¹ÙÀ̽º, 3=·çºñ¼¿, 4=¾ÆÅä¶ô, 5=¿¢¼Ò³ªÀÎ, 6=¼¼ºñ¾Ó½º // -------------------------------- if (tm === '4' && sm) { var tabIndex = parseInt(sm, 10) - 2; // sm 2ºÎÅÍ ½ÃÀÛÇϴϱî 0-based À妽º·Î º¸Á¤ var $tabs = $('.tab_list li'); if ($tabs.length && tabIndex >= 0 && tabIndex < $tabs.length) { // ÅÇ a active $tabs.find('a').removeClass('active'); $tabs.eq(tabIndex).find('a').addClass('active'); // ÅÇ ÄÁÅÙÃ÷ active var $tabCont = $('.tab_cont'); $tabCont.removeClass('active'); $tabCont.eq(tabIndex).addClass('active'); } } // -------------------------------- // 5. ³ª¸ÓÁö ±âÁ¸ ½ºÅ©¸³Æ® ¿øº» ±×´ë·Î // -------------------------------- $('.rnd_wrap .visual').addClass('on'); var win_H = $(window).height(); $('.sec03 .swiper-wrapper').css('height', win_H); // ÁÖ¿ä ¼öÃâ±¹°¡ var swiper01 = new Swiper('.nation_wrap .sec03 .swiper-container', { autoHeight: true, loop: true, slidesPerView: 'auto', slidesPerGroup: 1, spaceBetween: 50, autoplay: { delay: 3000, disableOnInteraction: false, }, pagination: { el: '.swiper-pagination', type: 'progressbar', }, breakpointsInverse: true, breakpoints: { 1024: { spaceBetween: 15 } } }); // µðÀÚÀÎ ¿¬±¸¼Ò full slide var swiper02 = new Swiper('.m_design .sec02 .swiper-container', { autoHeight: true, loop: true, slidesPerView: 'auto', slidesPerGroup: 1, autoplay: { delay: 4000, disableOnInteraction: false, }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, breakpointsInverse: true, }); // µðÀÚÀÎ ¿¬±¸¼Ò var swiper03 = new Swiper('.m_design .prd_slide .swiper-container', { autoHeight: true, loop: true, slidesPerView: 'auto', slidesPerGroup: 1, spaceBetween: 40, autoplay: { delay: 3000, disableOnInteraction: false, }, breakpointsInverse: true, breakpoints: { 480: { spaceBetween: 20 } } }); // ÅÇ ¸Þ´º (Ŭ¸¯ ½Ã) $(".tab_list a").click(function (e) { e.preventDefault(); var index = $(this).parents("li").index(); $(this).addClass("active").parents("li").siblings("li").children("a").removeClass("active"); $(".tab_cont").eq(index).addClass("active").siblings().removeClass("active"); }); // R&D¼¾ÅÍ ´õº¸±â ¹öư È¿°ú $('.rnd_center .more').hover(function () { $(this).parents('.cont_list').find('.more').toggleClass('on'); }); // Áٱ⼼Æ÷ ´õº¸±â $('.rnd_stem_cell .tab_cont .thumb').hover(function () { $(this).parents('.tab_cont').addClass('active').siblings('.tab_cont').removeClass('active'); }); }); // $(document).ready ³¡ }); // jQuery ³¡