$(function(){ // 页面加载动画效果 if (!(/msie [6|7|8|9]/i.test(navigator.useragent))){ var wow = new wow({ boxclass: 'wow', animateclass: 'animated', offset: 0, mobile: true, live: true }); wow.init(); }; var aheight = $('#nav li a').height(); var navheight = $('#nav').height()/2; var navwidth = $('#nav').width()/2; $('#nav li a').css('lineheight',aheight+'px'); $('#nav').css('marginleft',-navwidth+'px'); $('#nav').css('margintop',-navheight+'px'); // 导航展开 $('#navbtn').click(function(){ $('.mask').removeclass('hide1'); }); $('#navclose').click(function(){ $('.mask').addclass('hide1'); }); $(".mask").on("click",function(e){ var target = $(e.target); if(target.closest(".innerinfo").length == 0){ $(this).addclass('hide1'); }e.stoppropagation(); }); // banner轮播 var swiper1 = new swiper ('#page1', { pagination: '.pagination', loop: true, paginationclickable: true, nextbutton: '.swiper-button-next', prevbutton: '.swiper-button-prev', autoplay: 3000, effect : 'fade', speed:2000 }); // 关闭浮动新闻 $('.floatbar .floatcancel').click(function(){ $(this).parents('.floatbar').css('display','none'); }); // 内页头部导航切换 var swiper = new swiper('.headnav .swiper-container', { speed: 600, nextbutton: '.headnav .next', slidesperview: 4 }); swiper.slideto($('.headnav .swiper-container a.on').index()); var alength = $('.headnav .swiper-slide').length; if (alength<=4) { $('.headnav .next').css('display','none'); } var dheight = $('.project-detail .detail-top .right div p').height(); if (dheight<144) { $('#more').css('display','none') }else{ $('#more').css('display','block') } $('#more').click(function(){ if ($(this).html()=='【展开查看更多】') { $('.project-detail .detail-top .right div p').css('maxheight','none'); $('.project-detail .detail-top .right div p').css('height','auto'); $(this).html('【收回】'); }else{ $('.project-detail .detail-top .right div p').css('maxheight','144px'); $('.project-detail .detail-top .right div p').css('overflow','hidden'); $(this).html('【展开查看更多】'); } }); // var h = $('.detail-middle .detail-content').height(); // if (h>=294) { // alert(h) // $('.detail-middle a.detail-more').removeclass('hide'); // }else{ // $('.detail-middle a.detail-more').addclass('hide'); // } $(window).ready(function(){ var h = $('.detail-middle .detail-content').height(); if (h>=294) { $('.detail-middle a.detail-more').removeclass('hide'); }else{ $('.detail-middle a.detail-more').addclass('hide'); } }); $('.detail-middle a.detail-more').click(function(){ if ($(this).html()=='展开查看更多') { $('.project-detail .detail-middle .detail-content').css('height','auto'); $('.project-detail .detail-middle .detail-content').css('height','auto'); $(this).html('收回'); }else{ $('.project-detail .detail-middle .detail-content').css('height','300px'); $(this).html('展开查看更多'); } }); $('.aboutus .about-item a.item').click(function(){ if($(this).next('.detail-con').hasclass('hide')){ $(this).next('.detail-con').removeclass('hide'); $(this).children('i').html('-'); }else{ $(this).next('.detail-con').addclass('hide'); $(this).children('i').html('+'); } }); $('.recruitbtn').click(function(){ if($(this).next().next('.upload').hasclass('on')){ $(this).next().next('.upload').removeclass('on'); }else{ $(this).next().next('.upload').addclass('on'); } }); $('.recruitbtn0').click(function(){ if ($('.mask2').hasclass('hide2')) { $('.mask2 .upload').addclass('on'); $('.mask2').removeclass('hide2'); }else{ $('.mask2 .upload').removeclass('on'); $('.mask2').addclass('hide2'); } }); $(".mask2 .bg").on("click",function(e){ var target = $(e.target); if(target.closest(".innerinfo").length == 0){ $(this).parent().addclass('hide2'); $(this).prev('.upload').removeclass('on'); }e.stoppropagation(); }); $('.recruit .recruit-item').click(function(){ if ($(this).hasclass('on')) { $(this).removeclass('on') }else{ $(this).addclass('on') } }); })