/*** * 首页首屏js */ /** * 首页 共性技术研发、成果产业化服务、国际合作与人才培养 */ $("#businessBox1").hover(function() { $("#bg-ico1").stop().animate({ marginLeft: '0px', opacity: '1' }, 'slow'); $(this).addClass("active"); $("#blist1").stop().slideDown(); }, function() { $("#bg-ico1").stop().animate({ marginLeft: '-200px', opacity: '0' }, 'slow'); $(this).removeClass("active"); $("#blist1").stop().slideUp(); }); $("#businessBox2").hover(function() { $("#bg-ico2").stop().animate({ marginLeft: '0px', opacity: '1' }, 'slow'); $(this).addClass("active"); $("#blist2").stop().slideDown(); }, function() { $("#bg-ico2").stop().animate({ marginLeft: '-200px', opacity: '0' }, 'slow'); $(this).removeClass("active"); $("#blist2").stop().slideUp(); }); $("#businessBox3").hover(function() { $("#bg-ico3").stop().animate({ marginLeft: '0px', opacity: '1' }, 'slow'); $(this).addClass("active"); $("#blist3").stop().slideDown(); }, function() { $("#bg-ico3").stop().animate({ marginLeft: '-200px', opacity: '0' }, 'slow'); $(this).removeClass("active"); $("#blist3").stop().slideUp(); }); $("#businessBox4").hover(function() { $("#bg-ico4").stop().animate({ marginLeft: '0px', opacity: '1' }, 'slow'); $(this).addClass("active"); $("#blist4").stop().slideDown(); }, function() { $("#bg-ico4").stop().animate({ marginLeft: '-200px', opacity: '0' }, 'slow'); $(this).removeClass("active"); $("#blist4").stop().slideUp(); }); $("#businessBox5").hover(function() { $("#bg-ico5").stop().animate({ marginLeft: '0px', opacity: '1' }, 'slow'); $(this).addClass("active"); $("#blist5").stop().slideDown(); }, function() { $("#bg-ico5").stop().animate({ marginLeft: '-200px', opacity: '0' }, 'slow'); $(this).removeClass("active"); $("#blist5").stop().slideUp(); }); /** * 首页新闻栏目动画特效 */ $(".index-hot-news .media").hover(function() { $(this).find(".nr").show(); if ($(this).find(".bg").is(":animated")) { $(this).find(".bg").stop().animate({ width: '0%' }, 'slow'); } $(this).find(".bg").stop().animate({ width: '100%' }, 'slow'); }, function() { $(this).find(".nr").hide(); $(this).find(".bg").stop().animate({ width: '0%' }, 'slow'); }); /** * 合作伙伴 */ var mySwiper = new Swiper('.partner', { // loop: true, // 循环模式选项 slidesPerView: 4, // 如果需要分页器 pagination: { el: '.swiper-pagination', clickable: true, }, autoplay: { delay: 3000, stopOnLastSlide: false, disableOnInteraction: true, }, breakpoints: { 320: { //当屏幕宽度大于等于320 slidesPerView: 2, spaceBetween: 10 }, 980: { //当屏幕宽度大于等于980 slidesPerView: 3, spaceBetween: 20 }, 1200: { //当屏幕宽度大于等于1200 slidesPerView: 4, spaceBetween: 30 } } }) /** * 人才招聘页面 */ $(document).on('click', '.rc_box h3', function() { $(this).toggleClass("on") $(this).siblings("ul").slideToggle(600) $(this).siblings("ul").toggleClass("on") $(this).parent().siblings().find("ul").slideUp(600) $(this).parent().siblings().find("h3").removeClass("on") }) /** * 成果转化产品案例 */ $(function() { $('.achievements_list li').click(function() { var id = $(this).attr('name'); $("#" + id).show().siblings('div').hide(); $(this).addClass("active").siblings('li').removeClass('active'); }) }) /** * a标签跳转动画 */ /*$("a").click(function() { $("html, body").animate({ scrollTop: $($(this).attr("href")).offset().top - 20 + "px" }, 500); return false; //不要这句会有点卡顿 });*/ /** * 组织架构 */ $(function() { $('.zn-gen-jiagou .anniu li').click(function() { var id = $(this).attr('name'); $("#" + id).addClass("active").siblings('div').removeClass("active"); $(this).addClass("on").siblings('li').removeClass('on'); }) }) $(function() { $('.peoples').click(function() { var id = $(this).attr('name'); $("#" + id).show().siblings('.team_people').hide(); $(".team_people_all").show(); $(".team_people_all").addClass("zindex999"); }) }) $(function() { $('.team_people_all').click(function() { $(".team_people_all").hide(); $(".team_people").hide(); $(".team_people_all").removeClass("zindex999"); }) }) /*下拉隐藏*/ var p = 0; t = 0; $(window).scroll(function() { if ($(window).scrollTop() > 300) { p = $(this).scrollTop(); if (t <= p) { $('body').addClass('fixed'); } else { $('body').removeClass('fixed'); } t = p; } }); /*首页视频弹窗*/