// ¸ÞÀÎ ·Ñ¸µ À̹ÌÁö
$(function() {
var mIndex = 0;
var mCount = $("#mainSlide ul.imgRolling li").length;
var Interval = 4000;
var mTimer;
function mainInit() {
var wSize = $(window).width();
var mSize = $("#mainSlide ul.imgRolling li").width();
var wrapSize = $("#mainSlide > .visual_wrap").width();
if(wSize < 1025) {
$("#mainSlide ul.imgRolling li").css('width',wSize + 'px');
} else if(wSize > 1024 && wSize < 1401) {
$("#mainSlide ul.imgRolling li").css('width',(wSize - 200) + 'px');
} else {
$("#mainSlide ul.imgRolling li").css('width',wrapSize + 'px');
}
$("#mainSlide ul.imgRolling").css({left:-(mIndex*mSize) + 'px', width:(wSize*mCount) + 'px'});
}
function indicatorInit() {
var _li = "
";
for(i=0; i=mCount) {
mIndex = 0;
} else if(mIndex<0) {
mIndex = mCount -1;
}
$("#mainSlide ul.imgRolling").stop(true,false).animate({left:-(mSize*mIndex) + 'px'}, 800, 'easeInCubic');
$("#mainSlide .indicator li").removeClass('active');
$("#mainSlide .indicator li").eq(mIndex).addClass('active');
}
mTimer = setInterval(function() { mIndex++; mainSlide(); }, Interval);
$(document).on('click', '#mainSlide .indicator li', function() {
var $idx = $(this).index();
if(!$("#mainSlide ul.imgRolling").is(':animated')) {
clearInterval(mTimer);
mTimer = setInterval(function() { mIndex++; mainSlide(); }, Interval);
mIndex = $idx;
mainSlide();
}
});
$("#mainSlide .prev").click(function() {
if(!$("#mainSlide ul.imgRolling").is(':animated')) {
clearInterval(mTimer);
mTimer = setInterval(function() { mIndex++; mainSlide(); }, Interval);
mIndex--;
mainSlide();
}
});
$("#mainSlide .next").click(function() {
if(!$("#mainSlide ul.imgRolling").is(':animated')) {
clearInterval(mTimer);
mTimer = setInterval(function() { mIndex++; mainSlide(); }, Interval);
mIndex++;
mainSlide();
}
});
$(window).load(function() {
mainInit();
indicatorInit();
});
$(window).resize(function() {
mainInit();
});
});
// ¿ìÃø ¹è³Ê¿µ¿ª »óÇ° ÆäÀ̵å
$(function() {
var pIndex = 0;
var pInterval = 4000;
var pTimer;
function productInit() {
if($("#productFade").length > 0) {
var pCount = $("#productFade ul.imgList li").length;
var _li = "";
var i;
$("#productFade ul.imgList li:last").after($("#productFade ul.imgList li[data-index=0]"));
for(i=1; i<=pCount; i++) {
$("#productFade ol.pagination").append(_li);
}
$("#productFade ol.pagination li:first").addClass('on');
}
}
function productFade() {
var count = $("#productFade ul.imgList li").length;
pIndex++;
if(pIndex>=count) { pIndex = 0 }
$("#productFade ol.pagination li").removeClass('on');
$("#productFade ol.pagination li").eq(pIndex).addClass('on');
$("#productFade ul.imgList li").removeClass('active');
$("#productFade ul.imgList li:last").after($("#productFade ul.imgList li[data-index=" + pIndex + "]"));
$("#productFade ul.imgList li[data-index=" + pIndex + "]").addClass('active');
$("#productFade ul.imgList li[data-index=" + pIndex + "]").stop(true,false).animate({opacity:0}, 0);
$("#productFade ul.imgList li[data-index=" + pIndex + "]").stop(true,false).animate({opacity:1}, 800);
}
$(document).on('click', '#productFade ol.pagination li', function() {
var idx = $(this).index();
if(!$("#productFade ul.imgList li").is(':animated')) {
$("#productFade ul.imgList li").stop();
clearInterval(pTimer);
pTimer = setInterval(function() { productFade(); }, pInterval);
pIndex = idx-1;
productFade();
return false;
}
});
$("#productFade .pause").click(function() {
clearInterval(pTimer);
});
pTimer = setInterval(function() { productFade(); }, pInterval);
productInit();
});
// ¿ìÃø ¹è³Ê¿µ¿ª ·Ñ¸µ À̹ÌÁö
$(function() {
var sIndex = 0;
var sCount = $("#srepuSlide ul.imgList li").length;
var sTimer;
var sInterval = 4000;
function srepuSlide() {
var sSize = $("#srepuSlide ul.imgList li:first").width();
var wSize = $(window).width();
if(sIndex<0) {
sIndex = sCount - 1;
} else if(sIndex>=sCount) {
sIndex = 0;
}
$("#srepuSlide ul.imgList").stop(true,false).animate({left:-(sSize*sIndex) + 'px'}, 600, 'easeInCubic');
$("#srepuSlide ol.pagination li").removeClass('on');
$("#srepuSlide ol.pagination li").eq(sIndex).addClass('on');
}
function srepuInit() {
var sSize = $("#srepuSlide ul.imgList li:first").width();
var wSize = $(window).width();
if(wSize < 1025 && wSize > 639) {
$("#srepuSlide ul.imgList li").css('width',wSize/2 + 'px');
$("#srepuSlide ul.imgList").css({left:-(sIndex*sSize) + 'px'});
} else if(wSize <= 640) {
$("#srepuSlide ul.imgList li").css('width',wSize + 'px');
} else {
$("#srepuSlide ul.imgList li").removeAttr('style');
}
}
function pagingInit() {
var _li = "";
for(i=1; i<=sCount; i++) {
$("#srepuSlide ol.pagination").append(_li);
}
$("#srepuSlide ol.pagination li:first").addClass('on');
}
$(document).on('click', '#srepuSlide ol.pagination li', function() {
var idx = $(this).index();
if(!$("#srepuSlide ul.imgList li").is(':animated')) {
$("#srepuSlide ul.imgList li").stop();
clearInterval(sTimer);
sTimer = setInterval(function() { sIndex++; srepuSlide(); }, sInterval);
sIndex = idx;
srepuSlide();
return false;
}
});
sTimer = setInterval(function() { sIndex++; srepuSlide(); }, sInterval);
srepuInit();
pagingInit();
$(window).resize(function() {
srepuInit();
});
});