function checkDevice(){ var tmp = navigator.userAgent; if(tmp.indexOf('iPhone') > 0 || tmp.indexOf('iPod') > 0 || tmp.indexOf('Android') > 0) { //alert('mobile Á¢¼Ó'); $('body').addClass('mobile'); } else { //alert('pc Á¢¼Ó'); } } function resizeKV(){ var screenWidth = $(window).width(), screenHeight = $(window).height(), kvWrap = $('.main_wrap'), kvArea = $('.kv_main'), kvImage = kvArea.find('.img img'), kvWidth; if($('body').hasClass('mobile')) { kvImage.css({ 'left' : '50%', 'margin-left' : (kvImage.width()/2 * -1) + 'px' }) } else { if(screenWidth <= 990) { kvWidth = 990 - $('.main_content').width(); } else { kvWidth = screenWidth - $('.main_content').width(); } kvHeight = screenHeight - $('.header_wrap').innerHeight(); kvWrap.height(kvHeight); kvArea.width(kvWidth); kvImage.css({ 'left' : '50%', 'margin-left' : (kvImage.width()/2 * -1) + 'px' }) } } /* main KeyVisual*/ function kvSlide(){ $('.visual_list').bxSlider({ pause: 4000, speed: 1000, auto: true, controls:false, autoControls: true, autoHover: true, startText:'ÀÚµ¿ Àç»ý ½ÃÀÛ', stopText: 'ÀÚµ¿ Àç»ý Á¤Áö', pager: true, responsive:true, easing: 'easeOutCubic' }); }; function banSlide(){ $('.ban_list').bxSlider({ pause: 5000, auto: true, controls:true, autoControls: true, autoControlsCombine: true, autoHover: true, prevText: 'ÀÌÀü', nextText : '´ÙÀ½', startText:'ÀÚµ¿ Àç»ý ½ÃÀÛ', stopText: 'ÀÚµ¿ Àç»ý Á¤Áö', pager: false, responsive:true, easing: 'easeOutCubic' }); } function hover() { $('.main_wrap .con04 a, .con02 a, .con02_1 a, .con02_2 a, .con06 a, .main_wrap .con05 a').hover(function(){ $(this).find('.dimm').fadeIn(300); }, function(){ $(this).find('.dimm').fadeOut(300); }) } $(window).load(function(){ checkDevice(); resizeKV(); kvSlide(); banSlide(); hover(); }); $(window).resize(function(){ resizeKV(); });