//菜单 $(window).bind("load resize",function(){ var redW = $('.nav').offset().left; $('.menu .redbg').css('width',redW); console.log(redW); }); $('.nav>li').on('mouseover',function () { $(this).addClass('on'); }).on('mouseleave',function () { $(this).removeClass('on'); }); // 轮播主图 var mySwiper = new Swiper ('#swiper1', { loop: true, // 循环模式选项 autoplay:true, // 如果需要分页器 pagination: { el: '.swiper-pagination', clickable :true, }, navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, // 如果需要滚动条 scrollbar: { el: '.swiper-scrollbar', }, }); // 相册图片滚动 $(function () { var cc1 = new ScrollPic(); cc1.scrollContId = "hot_menu"; // 内容容器ID,picList1加到容器上, cc1.arrLeftId = "btnUp";//左箭头ID cc1.arrRightId = "btnNext"; //右箭头ID cc1.frameWidth = 1200; //显示框的宽度 cc1.pageWidth = 1; //翻页宽度 cc1.speed = 5; //移动速度(单位毫秒,越小越快) cc1.space = 10; //每次移动像素(单位px,越大越快) cc1.autoPlay = true; //自动播放 cc1.autoPlayTime = 0.01; //自动播放间隔时间(秒) cc1.initialize(); //初始化 }); // 企业风采 $('.about-menu a:first').addClass('on'); $('#about .about-photo').hide(); $('#about .about-photo:first').show(); $('.about-menu a').click(function () { $(this).addClass('on').siblings().removeClass('on'); var i = $(this).index(); $('#about .about-photo').hide(); $('#about .about-photo').eq(i).show(); }); new Swiper('#qiye .swiper', { loop: true, autoplay: true, slidesPerView: "auto", }); // 荣誉 new Swiper('#rongyu .swiper', { loop: true, autoplay: true, slidesPerView: "auto", }); // 新闻 var newsS = new Swiper('#newsImg .swiper', { effect : 'fade', navigation: { nextEl: '#newsImg .icon-up', prevEl: '#newsImg .icon-next' }, loop: true, autoplay: true, }); //内页 //点击切换 $('.features .video:first').show(); $('.icon_list li:first').addClass('on'); $('.icon_list li').click(function () { $(this).addClass('on').siblings().removeClass('on'); $('.features .video').hide(); var i = $(this).index(); $('.features .video').eq(i).show(); }); var thumbsSwiper = new Swiper('#thumbs',{ spaceBetween: 10, slidesPerView: 4, watchSlidesVisibility: true,/*避免出现bug*/ }); var gallerySwiper = new Swiper ('#swiper2', { // direction: 'vertical', // 垂直切换选项 loop: true, // 循环模式选项 autoplay:true, // 如果需要前进后退按钮 navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, spaceBetween: 10, thumbs: { swiper: thumbsSwiper, } }); // 更多 $(".more-page .icon-next").click(function(){ var w = $('#rightTable')[0].scrollWidth; $("#rightTable").scrollLeft(w); }); $(".more-page .icon-up").click(function(){ $("#rightTable").scrollLeft(0); }); //楼层动态 var oNav = $('#wrapNav');//导航壳 var aNav = $('#wrapNav .wrap>li');//导航 var aDiv = $('#mainP>.page');//楼层 $('#wrapNav .wrap>li:first').addClass('active'); var oTop = $('.icon-top'); //回到顶部 $(window).scroll(function(){ var winH = $(window).height();//可视窗口高度 var iTop = $(window).scrollTop();//鼠标滚动的距离 var toTop=$('#swiper1').height() + $('header').height(); //浮动导航到顶部的距离 if(iTop >= toTop ){ // oTop.fadeIn(); oNav.css({ 'position': 'fixed', top: 0 ,'width':'100%','z-index':'999' }); //鼠标滑动式改变 aDiv.each(function(){ if(winH+iTop - $(this).offset().top>winH/2){ aNav.eq($(this).index()).addClass('active').siblings().removeClass('active'); } }) }else{ // oTop.fadeOut(); oNav.css({ 'position': 'static' }); } }) // 点击top回到顶部 oTop.click(function(){ $('body,html').animate({"scrollTop":0},500) }); //点击回到当前楼层 aNav.click(function(){ var t = aDiv.eq($(this).index()).offset().top; $('body,html').animate({"scrollTop":t},500); $(this).addClass('active').siblings().removeClass('active'); }); // 视频自动播放