// ¸ÞÀÎ ·Ñ¸µ À̹ÌÁö $(function() { var vCount = $("#mainSlider ul.imgList li").length; var vIndex = 0; var vTimer; var vInterval = 100000; // ÀÚµ¿À¸·Î ½½¶óÀ̵ù µÇ´Â ÁÖ±â (´ÜÀ§ : ms) var swipeOptions = { triggerOnTouchEnd: true, swipeStatus: swipeStatus, allowPageScroll: "vertical", threshold: 10 }; // ¸ÞÀÎ ·Ñ¸µÀ̹ÌÁö ½º¿ÍÀÌÇÁ ¼ÂÆà function swipeStatus(event, phase, direction, distance) { vWidth = $("#mainSlider ul.imgList li").width(); if (phase == "move" && (direction == "left" || direction == "right")) { var duration = 0; if (direction == "left") { clearInterval(vTimer); $("#mainSlider ul.imgList").stop(true,false).animate({left:-(vWidth*vIndex) - distance + 'px'}, duration); } else if (direction == "right") { clearInterval(vTimer); $("#mainSlider ul.imgList").stop(true,false).animate({left:-(vWidth*vIndex) + distance + 'px'}, duration); } } else if (phase == "cancel") { mainSlide(); } else if (phase == "end") { if (direction == "right") { if(vIndex===0) { mainClear(); vIndex = 0; mainSlide(); return false; } mainClear(); vIndex--; mainSlide(); } else if (direction == "left") { if(vIndex===vCount-1) { vIndex = vCount-1; mainClear(); mainSlide(); return false; } mainClear(); vIndex++; mainSlide(); } } } $("#mainSlider ul.imgList").swipe(swipeOptions); // ÃʱâÈ function mainInit() { var wSize = $(window).width(); $("#mainSlider ul.imgList li").css('width',wSize + 'px'); $("#mainSlider ul.imgList").css('left',-(wSize * vIndex) + 'px'); } // ÆäÀÌÁö³×ÀÌ¼Ç ÃʱâÈ function pagingInit() { var _li = "
"; for(i=0; i