var SiteIndex = { hoverLinkMenu : function() { var navLineObj = $("#navLine"), currObj = null, currValue = ""; var map = { 'home' : 1, 'family' : 2, 'product' : 3, 'culture' : 4 }; var mouseenter = function() { currObj = $(this); currName = currObj.attr("data-menuanchor"); currValue = map[currName]; SiteIndex.menuNavi(currValue); }; var mouseleave = function() { $("#nav_list > li").each(function() { var currObj = $(this); if (currObj.attr("class") == "active") { currObj.mouseenter(); } }); }; $("#nav_list > li").hover(mouseenter, mouseleave) }, menuNavi : function(index) { var left = 0, navLineObj = $("#navLine"); switch (index) { case 1 : left = 0; case 2 : left = 0; break; case 3 : left = 120; break; case 4 : left = 240; break; } navLineObj.css({ "left" : left + "px" }); if (index == 1) { navLineObj.hide(); } else { navLineObj.show(); } }, productPage : function(anchorLink, index) { var _height = $(window).height(); $(".product-index").height(_height); $(".product-detail").height(_height - 200); }, btmInteractive : function() { $(".ui-container").width($(window).width()); var mouseenter = function() { $(this).animate({ height : "320px" }, 500); }; var mouseleave = function() { $(this).animate({ height : "240px" }, 300); }; $(".family-member-area").hover(mouseenter, mouseleave); }, ldway_more : function() { $("#ldway_more_open").click(function() { SiteIndex.ldway(); $("#index_slogan").animate({ "margin-left" : "450px" }, 300); $("#index_ldway").animate({ "height" : "650px" }, 300); }); $("#ldway_more_close").click(function() { SiteIndex.ldway(); $("#index_slogan").animate({ "margin-left" : "0px" }, 300); $("#index_ldway").animate({ "height" : "290px" }, 300); }); }, ldwayDataInit : function() { var _width = $("#ldSlider").width(); var blockWidth = $(".ld-event").width() + 30; var dataCount = $(".ld-events-list").children('div').length var lineBlockCount = parseInt(_width / blockWidth); var dotsCount = dataCount / lineBlockCount; if (parseInt(dotsCount) < dotsCount) { dotsCount = parseInt(dotsCount) + 1; }; }, ldway : function() { $("#ldSlider").toggle(); $("#ldLaymid").toggle(); $("#ldway_more_close").toggle() $("#ldway_more_open").toggle(); } } $(document).ready(function() { $('#page-container').fullpage({ anchors : ['home', 'family', 'product', 'culture'], menu : '#menu', scrollingSpeed : 500, afterLoad : function(anchorLink, index) { SiteIndex.menuNavi(index); SiteIndex.productPage(anchorLink, index); } }); SiteIndex.btmInteractive(); SiteIndex.ldway_more(); SiteIndex.hoverLinkMenu(); SiteIndex.ldwayDataInit(); });