define(['jquery'], function ($) { // 活跃导航条 function handleNavbarStatus (index) { index = index === undefined ? $('#navbarIndex').val() : index; $('.navbar_item').eq(index).addClass('active').siblings().removeClass('active'); } $('.js-robGift').on('click', function () { $('#GiftDetailDialog').fadeIn(200); }); $('#GiftDetailDialog .CloseDialog').on('click', function () { $('#GiftDetailDialog').fadeOut(200); }); $("#successDialog .closeSuccessDialog").on('click', function () { $('#successDialog').fadeOut(); window.location.reload(); }); // 锁定Y轴,纵向不可滚动 function lockY () { $('body').css({height:'100vh',overflow: 'hidden'}); } // 解锁Y轴 function unlockY () { $('body').css({height:'auto',overflow: 'auto'}); } // 底部背景图片的显示隐藏 function handleFixedBanner () { var isShow = sessionStorage.getItem('showFixedBanner'); if (isShow !== '0') { $('.banner_pic').show(); $('.banner_pic i').on('click', function () { sessionStorage.setItem('showFixedBanner', 0); $(this).parent().fadeOut(1000); $('.footer').css('margin-bottom', 0); }); } } // 关于我们页面切换 function switchPage(){ var url = window.location.search.split('=')[1]; if(url == "1"){ $('.contact-us').show().siblings().hide(); }else if(url == '2'){ $('.sincere-hire').show().siblings().hide(); }else if(url == '3'){ $('.customer-center').show().siblings().hide(); }else if(url == '4'){ $('.parents-care').show().siblings().hide(); }else{ $('.inner-about-us').show().siblings().hide(); } } return { handleNavbarStatus: handleNavbarStatus, lockY: lockY, unlockY: unlockY, handleFixedBanner: handleFixedBanner, switchPage: switchPage }; });