var e_no = 15; function initialization() { $("#fullpage").fullpage({ //loopTop: true, loopBottom: true, verticalCentered: false, css3: true, sectionsColor: [ "#fff", "#fff", "#fff", "#fff", "#fff", "#fff", "#fff", "#fff", "#fff", "#fff", "#fff", "#fff", "#fff", "#fff", "#fff", ], navigation: true, navigationPosition: "right", keyboardScrolling: true, scrollingSpeed: 600, responsiveSlides: true, fitToSection: false, afterLoad: function (anchorLink, index) { $("#fp-nav ul li").removeClass("on"); $("#fp-nav ul li:nth-child(" + index + ")").addClass("on"); if (index == 1) { $(".btn_page a.up").fadeOut(100); $(".btn_page a.down").fadeIn(100); $(".btn_page a.down img").attr( "src", "/base/img/_user/v3/images/ico_arrow_down.svg" ); } else if (index == e_no) { $(".btn_page a.up").fadeOut(100); $(".btn_page a.down img").attr( "src", "/base/img/_user/v3/images/ico_arrow_up.svg" ); } else { $(".btn_page a").fadeIn(100); $(".btn_page a.down img").attr( "src", "/base/img/_user/v3/images/ico_arrow_down.svg" ); } if ( index == 6 || index == 7 || index == 8 || index == 9 || index == 10 || index == 11 || index == 12 || index == 13 ) { $( "#fp-nav li:nth-child(6),#fp-nav li:nth-child(7),#fp-nav li:nth-child(8),#fp-nav li:nth-child(9),#fp-nav li:nth-child(10),#fp-nav li:nth-child(11),#fp-nav li:nth-child(12),#fp-nav li:nth-child(13)" ).addClass("onSix"); } else { $( "#fp-nav li:nth-child(6),#fp-nav li:nth-child(7),#fp-nav li:nth-child(8),#fp-nav li:nth-child(9),#fp-nav li:nth-child(10),#fp-nav li:nth-child(11),#fp-nav li:nth-child(12),#fp-nav li:nth-child(13)" ).removeClass("onSix"); } if (index == 1) { Animations("#section1 .animatable_0"); sto = setTimeout(function () { Animations("#section1 .animatable_1"); }, 600); sto = setTimeout(function () { Animations("#section1 .animatable_2"); }, 1200); sto = setTimeout(function () { Animations("#section1 .animatable_3"); }, 1400); } if (index == 2) { Animations("#section2 .animatable_0"); sto = setTimeout(function () { Animations("#section2 .animatable_1"); }, 600); sto = setTimeout(function () { Animations("#section2 .animatable_2"); }, 1200); sto = setTimeout(function () { Animations("#section2 .animatable_3"); }, 1600); sto = setTimeout(function () { Animations("#section2 .animatable_4"); }, 2200); } if (index == 3) { Animations("#section3 .animatable_0"); sto = setTimeout(function () { Animations("#section3 .animatable_1"); }, 600); sto = setTimeout(function () { Animations("#section3 .animatable_2"); }, 1200); sto = setTimeout(function () { Animations("#section3 .animatable_3"); }, 1600); } if (index == 4) { Animations("#section4 .animatable_0"); sto = setTimeout(function () { Animations("#section4 .animatable_1"); vert_vars(); }, 600); sto = setTimeout(function () { Animations("#section4 .animatable_2"); }, 1200); sto = setTimeout(function () { Animations("#section4 .animatable_3"); }, 1600); } if (index == 5) { Animations("#section5 .animatable_0"); sto = setTimeout(function () { Animations("#section5 .animatable_1"); }, 600); sto = setTimeout(function () { Animations("#section5 .animatable_2"); }, 1200); sto = setTimeout(function () { Animations("#section5 .animatable_3"); }, 1600); sto = setTimeout(function () { Animations("#section5 .animatable_4"); }, 2400); sto = setTimeout(function () { Animations("#section5 .animatable_5"); }, 3200); sto = setTimeout(function () { Animations("#section5 .animatable_6"); }, 4400); } if (index == 6) { Animations("#section6 .animatable_0"); sto = setTimeout(function () { Animations("#section6 .animatable_1"); }, 600); sto = setTimeout(function () { Animations("#section6 .animatable_2"); }, 1000); sto = setTimeout(function () { Animations("#section6 .animatable_3"); }, 1200); sto = setTimeout(function () { Animations("#section6 .animatable_4"); }, 1400); sto = setTimeout(function () { Animations("#section6 .animatable_5"); }, 1600); sto = setTimeout(function () { Animations("#section6 .animatable_6"); }, 1800); sto = setTimeout(function () { Animations("#section6 .animatable_7"); }, 2000); sto = setTimeout(function () { Animations("#section6 .animatable_8"); }, 2600); } if (index == 7) { Animations("#section7 .animatable_0"); sofaRandom("#section7", 4, 15); sto = setTimeout(function () { Animations("#section7 .animatable_1"); }, 600); sto = setTimeout(function () { Animations("#section7 .animatable_2"); }, 1000); sto = setTimeout(function () { Animations("#section7 .animatable_3"); }, 1600); } if (index == 8) { Animations("#section8 .animatable_0"); sto = setTimeout(function () { Animations("#section8 .animatable_1"); }, 600); sto = setTimeout(function () { Animations("#section8 .animatable_2"); }, 1000); sto = setTimeout(function () { Animations("#section8 .animatable_3"); }, 1600); } if (index == 9) { Animations("#section9 .animatable_0"); sto = setTimeout(function () { Animations("#section9 .animatable_1"); }, 600); sto = setTimeout(function () { Animations("#section9 .animatable_2"); }, 1000); sto = setTimeout(function () { Animations("#section9 .animatable_3"); }, 1600); sto = setTimeout(function () { Animations("#section9 .animatable_4"); }, 2000); } if (index == 10) { Animations("#section10 .animatable_0"); sto = setTimeout(function () { Animations("#section10 .animatable_1"); }, 600); sto = setTimeout(function () { Animations("#section10 .animatable_2"); }, 1000); sto = setTimeout(function () { Animations("#section10 .animatable_3"); }, 1600); sto = setTimeout(function () { Animations("#section10 .animatable_4"); }, 2000); } if (index == 11) { Animations("#section11 .animatable_0"); sto = setTimeout(function () { Animations("#section11 .animatable_1"); }, 600); sto = setTimeout(function () { Animations("#section11 .animatable_2"); }, 1000); sto = setTimeout(function () { Animations("#section11 .animatable_3"); }, 1600); sto = setTimeout(function () { Animations("#section11 .animatable_4"); }, 2000); } if (index == 12) { Animations("#section12 .animatable_0"); sto = setTimeout(function () { Animations("#section12 .animatable_1"); sofaRandom("#section12", 4, 15); }, 600); sto = setTimeout(function () { Animations("#section12 .animatable_2"); }, 1000); sto = setTimeout(function () { Animations("#section12 .animatable_3"); }, 1600); } if (index == 13) { Animations("#section13 .animatable_0"); sto = setTimeout(function () { Animations("#section13 .animatable_1"); }, 600); sto = setTimeout(function () { Animations("#section13 .animatable_2"); }, 1000); sto = setTimeout(function () { Animations("#section13 .animatable_3"); }, 1400); sto = setTimeout(function () { Animations("#section13 .animatable_4"); }, 1400); sto = setTimeout(function () { Animations("#section13 .animatable_5"); }, 1800); sto = setTimeout(function () { Animations("#section13 .animatable_6"); }, 2200); sto = setTimeout(function () { Animations("#section13 .animatable_7"); }, 2600); } if (index == 14) { Animations("#section14 .animatable_0"); sto = setTimeout(function () { Animations("#section14 .animatable_1"); }, 600); sto = setTimeout(function () { Animations("#section14 .animatable_2"); }, 1200); sto = setTimeout(function () { Animations("#section14 .animatable_3"); }, 1600); sto = setTimeout(function () { sofaRandom("#section14", 4, 12); }, 1000); } if (index == 15) { Animations("#section15 .animatable_0"); } }, onLeave: function (index, nextIndex, direction) {}, }); } //슬라이드 찾아가기 var moveS = function (url) { //console.log(url); if (url == "Bomsowa") { $.fn.fullpage.silentMoveTo(2); }else if(url == "material1"){ $.fn.fullpage.silentMoveTo(9); }else if(url == "material2"){ $.fn.fullpage.silentMoveTo(10); }else if(url == "material3"){ $.fn.fullpage.silentMoveTo(11); } }; // 연혁 > 프로그래스바 var vert_vars = function () { //$(".vert-bars li .bar").css('height',''); var j = 0; timer = setInterval(function () { if (j < $(".vert-bars li").length) { $(".vert-bars .bar:eq(" + j + ")").animate( { height: $(".vert-bars .value:eq(" + j + ")").html() }, 1000 ); j++; } else { clearInterval(timer); } }, 250); }; //소파 랜덤으로 나타나기 var sofaRandom = function (section, lower, upper) { var imgNo = []; var i = 0; var totalIndex = $(section + " div.img img").length; console.log("totalIndex >> " + totalIndex); for (var i = 0; i < totalIndex; i++) { let n = Math.floor(Math.random() * (upper - lower + 1)) + lower; if (!sameNum(n)) { imgNo.push(n); if (imgNo.length == totalIndex) { sofaDisplay(imgNo, section); console.log(imgNo); break; } } else { i--; } } function sameNum(n) { if (imgNo.indexOf(n) == -1) { return false; } else { return true; } } }; var sofaDisplay = function (imgNo, section) { var j = 0; run = setInterval(function () { if (j == imgNo.length) { clearInterval(run); } else { console.log(j); var a = imgNo[j]; Animations(section + " .animatable_" + a); j++; } }, 150); }; $(document).ready(function () { initialization(); //전체주소 var url = $(location).attr("href"); url = url.split("?"); moveS(url[1]); $("#fp-nav").append(''); $("#fp-nav .six").on("click", function (e) { e.preventDefault(); $.fn.fullpage.moveTo(6); }); }); //$(document).ready