// 배너 하나의 크기. var BANNER_WIDTH = 980; var SHOW_DURATION = 600; var AUTO_PLAY_TIME = 4000; // 우리가 움직이게 될 배너 컨텐츠 엘리먼트. var $banner_content; // 배너 전체 개수. var nBannerLength = 0; // 현재 화면에 보이고 있는 배너 인덱스 값. var nCurrentBannerIndex = 0; //움직임방향 next:0,prev:1; var play_dirction=0; // 배너 메뉴의 위치를 표시할 엘리먼트가 담길 변수. var $banner_dots; //화면넓이 var $bannerWidth; // 자동실행 타이머 아이디. var autoTImerID; //재생상태확인(1:자동재생중, 0:멈춤상태) var is_play=1; $(document).ready(function(){ initMenu(); initEventListener(); startAutoPlay(); }); $(window).resize(function(){ //화면크기변화시 넓이값 업데이트 $bannerWidth=$("#banner_content").width(); //변화에 따른 요소위치 재정렬 for(var i=0; i=nBannerLength) nIndex = 0; // n번째 배너 보이기. play_dirction = 0; this.showBannerAt(nIndex); } // nIndex에 해당하는 배너 보이기. function showBannerAt(nIndex){ if (nIndex != this.nCurrentBannerIndex) { // n번째 배너 위치 값 구하기. //var nPosition = -BANNER_WIDTH * nIndex; var nPosition = BANNER_WIDTH; // 배너 메뉴의 위치 값을 업데이트 시킴. this.showBannerDotAt(nIndex); //이전배너인덱스 pIndex = this.nCurrentBannerIndex; // 슬라이드 시작. $banner_content.stop(); for(var i=0; i