$(document).ready(function() { // 设置公共导航栏 // $("#header").load("./components/nav.html"); // 设置公共底部 $("#footer").load("./components/footer.html"); // 手风琴 $(".index-fa-c").children().first().css("width", "456px"); $('.index-fa-c').children().first().find('img:nth-child(1)').css("display", "none"); $('.index-fa-c').children().first().find('img:nth-child(2)').css("display", "block"); $('.index-fa-c').children().first().find('.fa-c-item-title').css("display", "none"); $('.index-fa-c').children().first().find('.fa-c-item-c').css("display", "block"); $(".index-fa-c>.fa-c-item").mouseover(function() { $(this).stop().find('img:nth-child(1)').css("display", "none"); $(this).stop().find('img:nth-child(2)').css("display", "block"); $(this).stop().find('.fa-c-item-title').css("display", "none"); $(this).stop().find('.fa-c-item-c').css("display", "block"); $(this).siblings().stop().find('img:nth-child(1)').css("display", "block") $(this).siblings().stop().find('img:nth-child(2)').css("display", "none") $(this).siblings().stop().find('.fa-c-item-title').css("display", "block") $(this).siblings().stop().find('.fa-c-item-c').css("display", "none") $(this).stop().animate({ "width":"456px" },500).siblings().stop().animate({ "width":"180px" }, 500) }) $(".index-fa-c>.fa-c-item").mouseout(function() { $(".index-fa-c>.fa-c-item").stop().animate({ "width":"180px" },500) $(this).stop().css("width", "456px"); $(this).stop().find('img:nth-child(1)').css("display", "none"); $(this).stop().find('img:nth-child(2)').css("display", "block"); $(this).stop().find('.fa-c-item-title').css("display", "none"); $(this).stop().find('.fa-c-item-c').css("display", "block"); }) // 运营运维一体化解决方案 $(".index-y-cate").children().first().addClass("index-y-active"); $('.index-y-cate-item').click(function () { $(this).addClass('index-y-active').siblings().removeClass('index-y-active') if ($(this).text() === '智慧场馆运营系统') { $('#index-y-image1').attr('src', './assets/images/home_img6@2x.png') $('#index-y-image2').attr('src', './assets/images/home_ic_yunying@2x.png') $('.index-y-content-info-title').text('智慧场馆运营系统') $('.index-y-content-info-dsc').text('整合场馆内部资源,对场馆的设施、设备、服务等进行智能化改造和升级,实现用户体验与营收双增长') } else { $('#index-y-image1').attr('src', './assets/images/home_img7@2x.png') $('#index-y-image2').attr('src', './assets/images/home_ic_yunw1ei@2x.png') $('.index-y-content-info-title').text('智慧场馆运维系统') $('.index-y-content-info-dsc').text('具有资产管理、仓储管理、设备巡检和商户管理等功能的运维管控平台,保障场馆安全高效运转') } }) // 多终端支持、提升运营效率 $(".index-a-c").children().first().addClass("index-a-c-active"); $("#index-a-1").css('display', 'flex') $("#index-a-2").css('display', 'none') $("#index-a-3").css('display', 'none') $("#index-a-4").css('display', 'none') $(".index-a-c>.index-a-c-item").mouseover(function() { $(this).addClass('index-a-c-active').siblings().removeClass('index-a-c-active') if ($(this).text() === '移动端') { $("#index-a-1").css('display', 'flex') $("#index-a-2").css('display', 'none') $("#index-a-3").css('display', 'none') $("#index-a-4").css('display', 'none') } else if ($(this).text() === 'PC端') { $("#index-a-1").css('display', 'none') $("#index-a-2").css('display', 'flex') $("#index-a-3").css('display', 'none') $("#index-a-4").css('display', 'none') } else if ($(this).text() === '自助端') { $("#index-a-1").css('display', 'none') $("#index-a-2").css('display', 'none') $("#index-a-3").css('display', 'flex') $("#index-a-4").css('display', 'none') } else if ($(this).text() === '数据大屏') { $("#index-a-1").css('display', 'none') $("#index-a-2").css('display', 'none') $("#index-a-3").css('display', 'none') $("#index-a-4").css('display', 'flex') } }) // 当页面滚动到一定距离时显示返回顶部按钮 $('#back-to-top').fadeOut(); $(window).scroll(function() { if ($(this).scrollTop() > 100) { // 这里可以根据需要调整数值 $('#back-to-top').fadeIn(); // 显示按钮 } else { $('#back-to-top').fadeOut(); // 隐藏按钮 } }); // 点击按钮时,页面平滑滚动到顶部 $('#back-to-top').click(function(event) { event.preventDefault(); // 阻止链接的默认行为 $('html, body').animate({scrollTop: 0}, 800); // 页面平滑滚动到顶部,800毫秒完成滚动 }); });