$(function(){ var load_t = sessionstorage.getitem("name"); if (load_t == null) { //第一次进来 $(".load video").css("opacity","1") $(".body_s").addclass("loadding"); sessionstorage.setitem('name', 'a'); setinterval(function () { $(".loadding").addclass("on"); }, 10000); var btime = 10000;//banner延迟加载的时间 } else { //刷新页面了 $(".load").hide(); $(".body_s").removeclass("loadding"); var btime = 0;//banner延迟加载的时间 //console.log(load_t,"刷新页面了"); } }) //首页banner图 var mybannerswiper = new swiper('#swiper1',{ pagination: { el: '.swiper-pagination', clickable :true, }, //effect: 'fade', autoplay: { delay: 4000, }, loop:true, }) //页面滚动导航出现 $(window).scroll(function() { //整体页面滚动 if ($(this).scrolltop() > 80) { //整体页面滚动大于a之后 $('.nav_part').addclass('fixd');// 添加menu-shrink } else { $('.nav_part').removeclass('fixd'); //否则删除menu-shrink } }); // 手机导航 var windowwidth = $(window).width(); if(windowwidth > 800){ $(function(){ $(".has").hover(function(){ //$(this).find(".two_nav_list").slidetoggle(""); $(".header_shade").toggleclass("on"); }) }) } if(windowwidth < 800){ $(function(){ $(".top_nav .nav_main ul li .one_level .zi .morejt").click(function(){ $(this).parents(".top_nav .nav_main ul li").find(".two_nav_list").slidetoggle(""); $(this).parents(".top_nav .nav_main ul li").toggleclass("on").siblings().removeclass("on"); $(this).parents(".top_nav .nav_main ul li").siblings().find(".two_nav_list").slideup(""); }) }) } var windowwidth = $(window).width(); if(windowwidth < 800){ $('.phone_menu').click(function () { $('.top_nav').toggleclass('show'); $(this).toggleclass('kai'); $('.nav_part').addclass('fixd'); }) } //以下是新城国际博览 //首页新闻切换 var swipernews = new swiper('.swiper-container-inform', { slidesperview: 1, spacebetween: 0, effect: 'fade', on: { slidechangetransitionstart: function() { $(".in-inform-cate .on").removeclass('on'); $(".in-inform-cate li").eq(this.activeindex).addclass('on'); } } }) $(".in-inform-cate li").on('mouseover', function(e) { $(".in-inform-cate li.on").removeclass('on'); $(this).addclass('on'); swipernews.slideto($(this).index()); }) var swiper2 = new swiper(".swiper-business", { spacebetween: 0, navigation: { nextel: ".swiper-button-next", prevel: ".swiper-button-prev", }, }); //首页关于介绍的白色背景宽度 var bwidth = $("body").width(); //获取焦点图的宽度(显示面积) var wwidth = $(".index_aboutzi .wal").width(); //获取焦点图个数 var kwidth = (bwidth - wwidth) / 2; //获取焦点图个数 $(".wriht-bg").css("left",(kwidth)); //页脚友情链接 $("body").click(function(){ $(".foot_main .select").removeclass("on"); $(".foot_main .select .pos").slideup(); }); $(".foot_main .select .friend_link h3").click(function(){ if($(this).parents(".select").hasclass("on")){ $(this).parents(".select").removeclass("on"); $(this).siblings(".pos").slideup(); }else{ $(".foot_main .select").removeclass("on"); $(".foot_main .select .pos").slideup(); $(this).parents(".select").addclass("on"); $(this).siblings(".pos").slidedown(); } return false; }); //关于我们页面视频弹窗 $('.videolist').each(function(){ //遍历视频列表 $(this).click(function(){ //这个视频被点击后执行 var img = $(this).attr('vpath');//获取视频预览图 var video = $(this).attr('ipath');//获取视频路径 $('.videos').html("
"); $('.videos').show(); $('.mostbig_con').addclass('zindex'); $('.live_video').addclass('zindex'); }); }); function close1(){ var v = document.getelementbyid('video');//获取视频节点 $('.videos').hide();//点击关闭按钮关闭暂停视频 $('.mostbig_con').removeclass('zindex'); $('.live_video').removeclass('zindex'); v.pause(); $('.videos').html(); } //关于我们企业成员切换 var swiperforum = new swiper('.swiper-container-forum', { slidesperview: 1, spacebetween: 0, effect: 'fade', on: { slidechangetransitionstart: function() { $(".in-forum-cate .on").removeclass('on'); $(".in-forum-cate li").eq(this.activeindex).addclass('on'); } } }) $(".in-forum-cate li").on('mouseover', function(e) { $(".in-forum-cate li.on").removeclass('on'); $(this).addclass('on'); swiperforum.slideto($(this).index()); }) //关于我们企业荣誉资质 var windowwidth = $(window).width(); if(windowwidth > 800){ var swiper = new swiper(".myswiper", { slidesperview: 4, grid: { rows: 2, }, spacebetween: 30, navigation: { nextel: ".swiper-button-next", prevel: ".swiper-button-prev", }, }); } if(windowwidth < 800){ var swiper = new swiper(".myswiper", { slidesperview: 2, grid: { rows: 1, }, spacebetween: 20, navigation: { nextel: ".swiper-button-next", prevel: ".swiper-button-prev", }, }); } //新闻列表切换 var swipernews = new swiper('.swiper-container-news', { slidesperview: 1, spacebetween: 0, on: { slidechangetransitionstart: function() { $(".in-news-cate .on").removeclass('on'); $(".in-news-cate li").eq(this.activeindex).addclass('on'); } } }) $(".in-news-cate li").on('mouseover', function(e) { $(".in-news-cate li.on").removeclass('on'); $(this).addclass('on'); swipernews.slideto($(this).index()); }) //党群工作切换 var swiper = new swiper(".myswiper_party", { slidesperview: 3, spacebetween: 30, navigation: { nextel: ".swiper-button-next", prevel: ".swiper-button-prev", }, }); //关于我们企业成员切换 var swiperbusn = new swiper('.swiper-container-image', { slidesperview: 1, spacebetween: 0, effect: 'fade', on: { slidechangetransitionstart: function() { $(".in-business-cate .on").removeclass('on'); $(".in-business-cate li").eq(this.activeindex).addclass('on'); } } }) var swiperbusn = new swiper('.swiper-container-business', { slidesperview: 1, spacebetween: 0, effect: 'fade', navigation: { nextel: ".swiper-button-next", prevel: ".swiper-button-prev", }, on: { slidechangetransitionstart: function() { $(".in-business-cate .on").removeclass('on'); $(".in-business-cate li").eq(this.activeindex).addclass('on'); } } }) $(".in-business-cate li").on('mouseover', function(e) { $(".in-business-cate li.on").removeclass('on'); $(this).addclass('on'); swiperbusn.slideto($(this).index()); }) $(".nsearch .next .inp").click(function(){ if($(this).hasclass("on")){ $(this).removeclass("on"); $(this).find(".pos").slideup(); }else{ $(".nsearch .next .inp").removeclass("on"); $(".nsearch .next .inp .pos").slideup(); $(this).addclass("on"); $(this).find(".pos").slidedown(); } return false; }); $(".nsearch .next .inp .pos a").click(function(){ $(this).parent(".pos").siblings(".clearfix").find("p").text($(this).text()) });