$.company = $.company || {}; $(document).ready(function(){ $.company.mainInit(); }); $.company.mainKeyVisual = function(){ var elSlider = $('.rollArea li'); var isAutoSlide = elSlider.length > 1 ? true : false; if ($('.visualArea ul').length > 0) { var slider_main_roll = $('.visualArea ul').bxSlider({ mode: 'horizontal', auto: isAutoSlide, pause: 5000, useCSS: true, controls: false, onSliderLoad: chageGauge(), onSlideAfter: function() { $('.wide .desGauge span').stop().css('width', '0'); slider_main_roll.stopAuto(); slider_main_roll.startAuto(); chageGauge(); } }); } } // reflex width check $.company.clientWidthCheck = function() { var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; if (windowWidth > 1023) { getWrap.removeClass('tablet mobile'); getWrap.addClass('wide'); } else if (windowWidth <= 1023 && windowWidth > 767) { getWrap.removeClass('wide mobile'); getWrap.addClass('tablet'); } else if (windowWidth <= 767) { getWrap.removeClass('wide tablet'); getWrap.addClass('mobile'); } } $.company.mainInit = function(){ $.company.mainKeyVisual(); } // visual Area Gauge function chageGauge() { $('.wide .desGauge span').css('width', '0'); $('.wide .desGauge span').stop().animate({width : '100%'}, 5000, function() {$(this).css('width', '0');}); }