$(function(){ //导航栏二级菜单 $('.header .header-nav .header-nav-list').hover(function(){ $(this).find('.header-nav-lista').css('color',"#b90909"); $(this).find('.header-nav-list-son').show(); },function(){ $(this).find('.header-nav-lista').css('color',"#000"); $(this).find('.header-nav-list-son').hide(); }) //导航栏滚动效果 window.onscroll = function () { var mydiv = $(".header"); if (getscrolltop() >= 10) { mydiv.css('background-color','rgba(255,255,255,1)'); $(".header-nav-lista").css('color','#000'); $(".header-nav-listas").css('color','#b90909'); } else{ mydiv.css('background-color','rgba(255,255,255,.6)'); } } function getscrolltop() { var scrolltop = 0; if (document.documentelement && document.documentelement.scrolltop) { scrolltop = document.documentelement.scrolltop; } else if (document.body) { scrolltop = document.body.scrolltop; } return scrolltop; } //首页tab切换效果 $('.new-list .new-list-secs .new-list-secs-list').eq(0).show().siblings().hide(); $('.new-list .new-list-top .new-list-topa').hover(function(){ let i=0; i=$(this).index(); $(this).addclass('new-list-topas').siblings().removeclass('new-list-topas'); $('.new-list .new-list-secs .new-list-secs-list').eq(i).show().siblings().hide(); }) // function banners(a,b,c,d){ // banner(a,b,c,d) // } // banners('.banners .banners-img','','','.banners-list .banners-div-list') $(window).scroll(function(){ // console.log($(window).scrolltop()) if ($(window).scrolltop() >= 200) { $('.new-banner ').addclass('bounceinleft'); $('.new-list').addclass('bounceinright'); } else{ $('.new-banner ').removeclass('bounceinleft'); $('.new-list').removeclass('bounceinright'); }; if ($(window).scrolltop() >= 600) { $('.yewu-top ').addclass('bouncein'); $('.yewu-list').addclass('bounceinup'); } else{ $('.yewu-top').removeclass('bouncein'); $('.yewu-list').removeclass('bounceinup'); }; if ($(window).scrolltop() >= 1300) { $('.dangqun').addclass('flipiny'); $('.scompany').addclass('flipiny'); } else{ $('.dangqun').removeclass('flipiny'); $('.scompany').removeclass('flipiny'); } if ($(window).scrolltop() >= 1600) { $('.ztpic-top1').addclass('bounceinleft'); $('.ztpic-top2').addclass('bounceinright'); } else{ $('.ztpic-top1').removeclass('bounceinleft'); $('.ztpic-top2').removeclass('bounceinright'); } if ($(window).scrolltop() >= 1900) { $('.links-top').addclass('fadeindownbig'); $('.links-bottom').addclass('fadeinupbig'); } else{ $('.links-top').removeclass('fadeindownbig'); $('.links-bottom').removeclass('fadeinupbig'); } }); }) //首页功能 var swiper = new swiper(".myswiper", { spacebetween: 30, centeredslides: true, autoplay: { delay: 2500, disableoninteraction: false, }, pagination: { el: ".swiper-pagination", clickable: true, }, navigation: { nextel: ".swiper-button-next", prevel: ".swiper-button-prev", }, }); // end // 首页轮播图 //分页插件 new pagination({ element: '#pages', type: 1, pageindex: 1, pagesize: 10, pagecount: 5, total: 100, jumper: true, singlepagehide: false, prevtext: '上一页', nexttext: '下一页', disabled: true, currentchange: function(index) { // console.log(index); } });