window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)]; var PC = $(window).width() > 992 jQuery(document).ready(function($) { //header if(!PC){ $('.header').append(''); $('.mNavBtn').click(function () { $(this).toggleClass('active'); $('.header .nav').toggleClass('active'); }); }else{ $(window).scroll(function(){ if($(window).scrollTop() > 10){ $('.header .tip').slideUp(); }else{ $('.header .tip').slideDown(); } }) } $('.header .nav li').each(function(){ var h = $(this).find('.left').outerHeight(); $(this).find('.drop_menu').height(h); }) $('.js_search').click(function(){ $('.js_header_form').addClass('show'); $('.js_header_tip').addClass('hide') }) $("body").click(function () { $('.js_header_form').removeClass('show'); $('.js_header_tip').removeClass('hide') }); $(".js_header_form input,.js_header_form button,.js_search").click(function () { var evt = new Object; if (typeof (window.event) == "undefined") { evt = arguments.callee.caller.arguments[0]; } else { evt = event || window.event; } evt.cancelBubble = true; }); $('.js_header_form button').click(function(){ var _this = $('.js_header_form input[type="text"]'); var _val = _this.val(); val = $.trim(_val); if (val == "") { alert("关键字不能为空"); return false; } }) //count if($('.count').length){ $('.count').countUp(); } // common title $('.comm_tit h3').each(function(){ $(this).html(commTit($(this).text(),$(this))) }) // video $('.video_btn').click(function(){ $('body').addClass('hidden'); var _url = $(this).attr('video_url') $('.video_pop video').attr('src',_url) $('.video_pop video')[0].play(); $('.video_pop').fadeIn(400); }) $('.video_pop .close,.video_pop .bg').click(function(){ $('.video_pop video')[0].pause(); $('.video_pop').fadeOut(400); $('body').removeClass('hidden'); }) $('.comm_pop .close, .comm_pop .bg').click(function(){ $('.comm_pop').fadeOut(); $('body').removeClass('hidden'); }) // research direction $('.js_sec1 .tab_tit span').click(function(){ $(this).addClass('active').siblings().removeClass('active'); $('.js_sec1 .child[data_index='+$(this).index()+']').show().siblings().hide(); }) // research support detail $('.js_sec2 .item a').click(function(){ $('body').addClass('hidden'); $('.ifr_pop h3').text($(this).find('h3').text()) $('.ifr_pop iframe').attr('src',$(this).attr('data_url')) $('.comm_pop').fadeIn(); }) //about regulation if($('.js_sec3 .left').length && PC){ var leftOffset = $('.js_sec3 .left').offset().top; $(window).scroll(function(){ if($(window).scrollTop() + $(window).height() + $('.footer').height() >= $(document).height()){ $('.js_sec3 .left').addClass('visi') }else{ $('.js_sec3 .left').removeClass('visi') } if($(window).scrollTop()>leftOffset - $('.header .main').height() - 50){ $('.js_sec3 .left').addClass('fixed').css('top',$('.header .main').height() + 50); }else{ $('.js_sec3 .left').removeClass('fixed').removeAttr('style') } $('.js_sec3 .right .box').each(function(){ var h = $(this).offset().top - $('.header .main').height(); if($(window).scrollTop() > h){ $('.js_sec3 .left a').eq($(this).index()).addClass('active').siblings().removeClass('active'); } }) }) $('.js_sec3 .left a').click(function(){ $(this).addClass('active').siblings().removeClass('active') var index = $(this).index(), h = $('.js_sec3 .right .box').eq(index).offset().top - $('.header .main').height(); $('html,body').animate({ scrollTop: h }, 500) }) } //about regulation 获取url后面的参数 var query = window.location.hash; query = query.replace('#', ''); if(query){ $('html,body').animate({ scrollTop: $('.js_sec3 .right .box').eq(query).offset().top - $('.header .main').height() }, 0) } //recruit $('.js_sec4 .form li').click(function(){ var text = $(this).text(); $(this).parents('.box').find('input').attr('value',text); }) $('.js_sec4 .list').click(function(){ $('body').addClass('hidden'); var desc = $(this).find('.desc').text(), tit = $(this).find('span').eq(0).text(), yaoqiu = $(this).find('.yaoqiu').html(), gangwei = $(this).find('.gangwei').html(), daiyu = $(this).find('.daiyu').html(), shenqing = $(this).find('.shenqing').html(); $('.js_rec_pop1').fadeIn(); $('.js_rec_pop1 h3 span').text(tit); $('.js_rec_pop1 .desc').html(desc); $('.js_rec_pop1 .gangwei p').html(gangwei); $('.js_rec_pop1 .yaoqiu p').html(yaoqiu); $('.js_rec_pop1 .daiyu p').html(daiyu); $('.js_rec_pop1 .shenqing p').html(shenqing); }) $('.js_sec7 .item a').click(function(){ $('body').addClass('hidden'); var desc = $(this).parent().find('p').text(), tit = $(this).parent().find('h3').text(), detail = $(this).parent().find('.detail').html(); console.log(desc) $('.js_rec_pop2').fadeIn(); $('.js_rec_pop2 h3 span').text(tit); $('.js_rec_pop2 .desc').html(desc); $('.js_rec_pop2 .box').html(detail); }) var uppercaseNumber = ['壹','贰','叁','肆','伍','陆','柒','捌','玖','拾']; for(var i=0;i<$('.js_sec7 .item').length;i++){ $('.js_sec7 .item').eq(i).find('span').text(uppercaseNumber[i]); } //meeting form $('.js_sec5 li').click(function(){ var text = $(this).text(); $(this).parents('.box').find('input').attr('value',text); }) $('.js_sec5 .reset').click(function(){ document.getElementById("js_sec5_form").reset(); $('.js_sec5 input[data-toggle="dropdown"]').attr('value',''); return false; }) // $('.js_sec5 .submit').click(function(){ // $('.fixed_sucpop').fadeIn(); // return false; // }) $('.fixed_sucpop .close').click(function(){ $('.fixed_sucpop').fadeOut(); }) //team detail & detail share if($('.comm_share').length && PC){ var shareOffset = $('.comm_share').offset().top, fixedTop = $('.header .main').height() + 40, scTop = shareOffset - $('.header .main').height() - 40; } if($('.js_comm_sec4').length && PC){ var offsetRight = $(window).width() - $('.js_comm_sec4').offset().left - $('.js_comm_sec4').outerWidth(); } if($('.footer').offset().top > $(window).height() && PC){ $(window).scroll(function(){ if($(window).scrollTop() + $(window).height() + $('.footer').height() >= $(document).height()){ $('.js_sec6,.comm_share,.js_comm_sec4').addClass('visi'); }else{ $('.js_sec6,.comm_share,.js_comm_sec4').removeClass('visi'); } if($(window).scrollTop() > scTop){ $('.comm_share').css({ 'position':'fixed', 'top': fixedTop, 'left': $('.comm_share').offset().left }) if($('.js_comm_sec4').length){ $('.js_comm_sec4').css({ 'position':'fixed', 'top': fixedTop, 'right': offsetRight }) } if($('.js_sec6').length){ $('.js_sec6').css({ 'position':'fixed', 'top': fixedTop, 'left': $('.js_sec6').offset().left }) } }else{ $('.comm_share,.js_sec6,.js_comm_sec4').removeAttr('style'); } }) } }); function commTit(str,obj){ var length = 0, newstr = "", arr = [], text = $(obj).text(); if(str){ length = str.length; }else{ return ; } for(var k = 0;k"; } return newstr; } function indexInit(){ // section1 $('.section1 .bg_slick').slick({ arrows: false, draggable: false, fade: true, }) $('.section1 .slick').slick({ arrows: false, draggable: false, dots: true, responsive:[ { breakpoint:992, settings:{ autoplay: true, autoplaySpeed: 2000, } } ] }) $('.section1 .prev').click(function(){ $('.section1 .bg_slick').slick('slickPrev'); $('.section1 .slick').slick('slickPrev'); }) $('.section1 .next').click(function(){ $('.section1 .bg_slick').slick('slickNext'); $('.section1 .slick').slick('slickNext'); }) // section2 $('.section2 .item').each(function(){ if(!$(this).find('.top_block .img_block').length>0){ $(this).addClass('no_img').find('.bot_block h3').remove(); } }) $('.section2 .slick').slick({ // variableWidth: true, slidesToShow: 4, arrows: false, // draggable: false, infinite: false, dots: true, responsive:[ { breakpoint:992, settings:{ slidesToShow: 1, infinite: true, } } ] }) $('.section2 .prev').click(function(){ $('.section2 .slick').slick('slickPrev'); }) $('.section2 .next').click(function(){ $('.section2 .slick').slick('slickNext'); }) // section3 if(PC){ $('.section3 ul').liMarquee(); } // section4 $('.section4 .item').mouseenter(function(){ if(!$(this).hasClass('active')){ $(this).addClass('active').siblings().removeClass('active') } }) // section5 $('.section5 .slick').slick({ arrows: false, draggable: false, // infinite: false, dots: true, fade: true, adaptiveHeight: true, autoplay: true, autoplaySpeed: 3000, }) // section6 $('.section6 .video_slick').slick({ arrows: false, draggable: false, infinite: false, }) $('.section6 .txt_slick').slick({ arrows: false, draggable: false, infinite: false, dots: true, asNavFor: '.section6 .video_slick' }) // section7 $('.section7 .items').slick({ arrows: false, draggable: false, infinite: false, dots: true, slidesToShow: 4, slidesToScroll: 4, responsive:[ { breakpoint:992, settings:{ slidesToShow: 1, slidesToScroll: 1, } } ] }) }