$(document).ready(function(){ // panoramaTypeA 타입 if($('#panoramaTypeA')[0]){ var anchorArrs = []; var dataAnchor = 1; $('.section').each(function(k, elm){ $(elm).attr('data-anchor', dataAnchor); var active = ''; if(dataAnchor == 1){ active = 'active'; } $('#main_menu').append('
  • '); anchorArrs.push(dataAnchor + ''); dataAnchor++; }); $('#fullpage').fullpage({ 'verticalCentered': false, 'css3': true, 'lockAnchors':true, 'slidesNavigation':true, 'afterRender': function () { setInterval(function () { $.fn.fullpage.moveSlideRight(); }, 3000) }, 'anchors': anchorArrs, 'menu': '#main_menu' }); $(document).on('click', '.menuDirectAnchors', function(){ $.fn.fullpage.moveTo($(this).attr('data-set')); }); } // panoramaTypeA001 타입 else if($('#panoramaTypeA001')[0]){ var anchorArrs = []; var dataAnchor = 1; $('.section').each(function(k, elm){ $(elm).attr('data-anchor', dataAnchor); var active = ''; if(dataAnchor == 1){ active = 'active'; } $('#main_menu').append('
  • '); anchorArrs.push(dataAnchor + ''); dataAnchor++; }); $('#fullpage').fullpage({ 'verticalCentered': false, 'css3': true, 'lockAnchors':true, 'slidesNavigation':true, 'afterRender': function () { setInterval(function () { $.fn.fullpage.moveSlideRight(); }, 3000) }, 'anchors': anchorArrs, 'menu': '#main_menu' }); $(document).on('click', '.menuDirectAnchors', function(){ $.fn.fullpage.moveTo($(this).attr('data-set')); }); } // panoramaTypeB 타입 else if($('#panoramaTypeB')[0]){ var anchorArrs = []; var dataAnchor = 1; $('.section').each(function(k, elm){ $(elm).attr('data-anchor', dataAnchor); var active = ''; if(dataAnchor == 1){ active = 'active'; } $('#main_menu').append('
  • '); anchorArrs.push(dataAnchor + ''); dataAnchor++; }); $('#fullpage').fullpage({ 'verticalCentered': false, 'css3': true, 'lockAnchors':true, 'slidesNavigation':true, 'afterRender': function () { setInterval(function () { $.fn.fullpage.moveSlideRight(); }, 3000) }, 'anchors': anchorArrs, 'menu': '#main_menu', 'onLeave' : function(origin, destination, direction){ console.log(origin, destination, direction); if(direction == 'down'){ pageMove($('#fullpage').find('.animation').eq(destination - 1)); }else{ pageMove($('#fullpage').find('.animation').eq(destination - 1)); } } }); $(document).on('click', '.menuDirectAnchors', function(){ $.fn.fullpage.moveTo($(this).attr('data-set')); }); pageMove($('#fullpage').find('.animation').eq(0)); } });