$(function () { var globalWinw = $(window).width(); // ==S header var divs=$(".index-main").find(".contents"); var navLis=$("#pc-nav").find("ul").find("li"); if(globalWinw>1000){ $(document).scroll(function(){ var scrollT = $(document).scrollTop(); if(scrollT==0){ $(".header").css("background","transparent") $(".header").css("border-bottom","none") }else{ $(".header").css("background","white") $(".header").css("border-bottom","1px solid #e2e2e2") }; }) } // navLis.on("click",function(){ // $(this).addClass("active").siblings().removeClass("active"); // var index=$(this).index(); // var H=divs[index+3].offsetTop; // $('html,body').stop().animate({ // 'scrollTop': H // },300); // }); if(globalWinw<=1000){ var flag=true; var wrapLis=$(".menue-wrap").find("li"); wrapLis.on("click",function(){ $(this).addClass("active") $(this).siblings().removeClass("active"); $(".menue-wrap").slideToggle(); flag2=!flag2; $(".wap_navbtn").removeClass("close"); var index=$(this).index(); var H=divs[index].offsetTop-50; $('html,body').animate({ scrollTop: H }, 500); }); var flag2=true; $(".wap_navbtn").on("click",function(){ var wHeight=$(window).height(); $(".menue-wrap").css("height",wHeight) if(flag2){ $(this).removeClass("close"); $(".menue-wrap").slideDown(); flag2=!flag2; } else{ $(this).addClass("close"); $(".menue-wrap").slideUp(); flag2=!flag2; } }) } // $('a[href*=#],area[href*=#]').click(function() { // if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { // var $target = $(this.hash); // $target = $target.length && $target || $('[name=' + this.hash.slice(1) + ']'); // if ($target.length) { // var targetOffset = $target.offset().top; // $('html,body').animate({ // scrollTop: targetOffset // }, 500); // return false; // } // } // }); // ==E header // ==S banner if (globalWinw > 768) { // $('.banner-v2').height($('.conference-int-v2 .pic img').height()); $('.conference-int-v2 .pic img').css('marginTop', -$(window).height()); } function bannerInit(options) { var obj = $(options.obj), winw = $(window).width(), winh = $(window).height(); if ((winw / winh) > (options.proportion)) { // 当视频100%显示的时候,视频高度比浏览器尺寸高 obj.css({ 'top': -(winw / options.proportion - winh) / 2, 'width': '100%' }); } else { // 当视频100%显示的时候,视频高度比浏览器尺寸低 obj.css({ 'left': -(winh * options.proportion - winw) / 2, 'height': '100%', 'width': 'auto' }); } } if (globalWinw > 768) { bannerInit({ obj: '.banner .video video', proportion: 1920 / 1080 }); } else { // bannerInit({ // obj: '.banner .video .pic img', // proportion: 750 / 1333 // }); } var resizeTimer = null; $(window).on("resize.banner", function () { clearTimeout(resizeTimer); resizeTimer = setTimeout(function () { if (globalWinw > 768) { // bannerInit({ // obj: '.video video', // proportion: 1920 / 1080 // }); // ==S banner if (globalWinw > 768) { // $('.banner-v2').height($('.conference-int-v2 .pic img').height()); $('.conference-int-v2 .pic img').css('marginTop', -$(window).height()); } } }, 200); }) // banner文字动画 // function indexBannerAnimated() { // if (globalWinw > 1200) { // $('.banner .con .cistern .text h1').addClass('animated bounceInUp'); // $('.banner .con .cistern .text p').addClass('animated bounceInUp'); // $('.banner .con .cistern .text span').addClass('animated bounceInUp'); // setTimeout(function () { // $('.banner .con .cistern .text a').addClass('animated bounceInUp'); // }, 150) // } // } function indexBannerAnimatedV2() { if (globalWinw > 1200) { $('.banner-v2 .con .cistern .text h1').addClass('animated bounceInUp'); $('.banner-v2 .con .cistern .text p').addClass('animated bounceInUp'); $('.banner-v2 .con .cistern .text span').addClass('animated bounceInUp'); setTimeout(function () { $('.banner-v2 .con .cistern .text a').addClass('animated bounceInUp'); }, 150) } } // ==E banner //刷新回到顶部 window.onload = function(){ setTimeout(function(){ $(window).scrollTop(0) },10)} })