/*================================================================ PR001 Module JS Version : 1.0 Release : 2018-01-16 Copyright by ONEPIXEL-STUDIO All Rights Reserved. ================================================================*/ /*================================ SUB PAGE ================================*/ // 둘러보기 스크립트 $(document).ready(function() { var old_images = []; // 최초 상태의 각 탭 메인 썸네일을 변수에 저장 $("#facilitySlider .big-thumb .thumb-list > li").each(function(i) { old_images[i] = $(this).find('img').attr('src'); i++; }); // 1단계 : 층별 탭 클릭시 보여지는 탭 내용을 교체 & 각 층의 대표 이미지로 초기화 $("#facilitySlider .big-thumb .floor-tab > li").click(function() { var tab_index = $(this).index(); $("#facilitySlider .big-thumb .floor-tab > li").removeClass('active'); $(this).addClass('active'); $("#facilitySlider .big-thumb .thumb-list > li").removeClass('active'); $("#facilitySlider .big-thumb .thumb-list > li").eq(tab_index).find('img').attr('src', old_images[tab_index]); $("#facilitySlider .big-thumb .thumb-list > li").eq(tab_index).addClass('active'); $("#facilitySlider .floor-container > .floor-info .thumb-list > li").removeClass('selected'); $("#facilitySlider .floor-container > .floor-info").removeClass('active'); $("#facilitySlider .floor-container > .floor-info").eq(tab_index).addClass('active'); }); // 2단계 : 각 층별 내부 썸네일 클릭시 대형 썸네일 교체 $("#facilitySlider .floor-container > .floor-info .thumb-list > li").click(function() { var thumb_img = $(this).find('img').attr('src'); $("#facilitySlider .floor-container > .floor-info .thumb-list > li").removeClass('selected'); $(this).addClass('selected'); $("#facilitySlider .big-thumb .thumb-list > li.active").find('img').attr('src', thumb_img); }); }); /* Sub Navigation Active */ $(document).ready(function() { var url = $(location).attr('href'); var navItems = $('#subVisual nav ul > li'); navItems.each(function() { if(url.indexOf($(this).find('>a').attr('href')) > -1) $(this).addClass('active'); }); $('#subVisual nav > a').text($('#subVisual nav ul > li.active').text()); }); /* Sub Navigation for for under pc devices */ var navWrap = $('#subVisual nav'); var navDrop = navWrap.find('>a'); $(document).ready(function() { navDrop.click(function() { $(this).parent().toggleClass('open'); $(this).parent().find('ul').stop().slideToggle(400); }); }).on('click', function(e) { if(!$(e.target).is('#subVisual nav>a')) { navWrap.removeClass('open'); navWrap.find('ul').stop().slideUp(400); } }); /* About Company Type2 - skill bar */ $(document).ready(function() { var skillBar = $('#container .about-skill-type2 .skill>.skill-wrap'); skillBar.each(function() { var bar = $(this).find('>.progress-bar'); bar.css({width:bar.data('percent') + '%'}); bar.find('>.percent').text(bar.data('percent') + '%'); }); }); /* Subpage Parallax */ /*$(document).ready(function() { $('#subVisual').parallax('50%', 0.3); $('#container .about-video-type2').parallax('50%', 0.3); $('#container .about-count-type2').parallax('50%', 0.3); $('#container .business-overview-mid').parallax('50%', 0.3); $('#container .business-contact').parallax('50%', 0.3); });*/ /* About Company Type2 - Promotion Modal */ $(document).ready(function() { var modal = ''; var modalMask = ''; var modalHTML = ''; var modalBtn = $('#container .about-video-type2 .btn-video'); var openPromotion = function(src) { if($('#modalPromotion').length) $('#modalPromotion').remove(); modalHTML += '
'; modalHTML += '
'; modalHTML += ''; modalHTML += '
'; modalBtn.addClass('load'); $('body').append(modalHTML); modalHTML = ''; modal = $('#modalPromotion'); modalMask = modal.find('>.overlay'); modal.find('iframe').load(function() { setTimeout(function() { modal.stop().fadeIn('slow').addClass('show'); modalBtn.removeClass('load'); }, 200); }); modalMask.click(function() { closePromotion(); }); }; var closePromotion = function() { modalHTML = ''; modal = $('#modalPromotion'); modal.stop().fadeOut('slow').removeClass('show'); setTimeout(function() { modal.remove(); modalBtn.removeClass('load'); }, 1000); }; modalBtn.click(function() { var src = $(this).data('video-src'); if(!$(this).hasClass('load')) openPromotion(src); }); }); /* About Company Type2 - number counting */ var counted = false; $(window).bind('scroll', function() { if($('#container .about-count-type2').length) { var counterOffset = $('#container .about-count-type2').offset().top - window.innerHeight; var scrollTop = $(this).scrollTop(); if(counted == false && scrollTop >= counterOffset) { $('#container .about-count-type2 span.count').each(function() { var _this = $(this), countTo = _this.data('count'); $({ countNum: _this.text() }).animate({ countNum: countTo }, { duration: 2500, easing: 'swing', step: function() { _this.text(Math.floor(this.countNum)); }, complete: function() { _this.text(this.countNum); } }); }); counted = true; } } }); /* Location */ $(document).ready(function() { $('#container .location-tab > li').click(function() { var tabIndex = $(this).index(); var tabContainer = $('#container .location-tab-con'); tabContainer.hide(); tabContainer.eq(tabIndex).fadeIn(400); $(this).parent().children().removeClass('active'); $(this).addClass('active'); }); }); /* Business Overview */ $(document).ready(function() { var hoverItem = $("section.business-detail .detail-items > li"); hoverItem.mouseenter(function() { hoverItem.addClass('off'); $(this).removeClass('off').addClass('on'); }).mouseleave(function() { hoverItem.removeClass('on off'); }); }); (function($) { $('.tabList-list-item').on('click', function() { // Remove Active from All $('.tabList-list-item').removeClass('active'); $('.tabList-tab').removeClass('active'); // Active Tabs Variable var active = $(this).data('tab-select'); // Add Active Class to Selected $(this).addClass('active'); $('.tabList-tab[data-tab-item='+active+']').addClass('active'); }); })(jQuery);