var ismobile = false,//区分移动端与pc端 mobile = false,//区分手机端与平板 w_width = 0, w_height = 0; function pagebox() { w_width = $(window).width(); w_height = $(window).height(); if (w_width <= 1024) { ismobile = true; $('html').addclass("mobiletrue"); $('html').removeclass("mobilefalse"); } else if (w_width > 1024) { ismobile = false; $('html').addclass("mobilefalse"); $('html').removeclass("mobiletrue"); } if (w_width <= 640) { mobile = true; $('.ny_banner').css({'margin-top':$('.mobileheader').height()+'px'}); } else if (w_width > 640) { mobile = false; } } pagebox(); $(function () { var d_height = $(document).height(); var d_width = $(document).width(); var bg_open = false; //首页滚动 //if(window.location == host_root || window.location == host_root_en){ $('#fullpage').fullpage({ sectionscolor:['#ffffff','#ffffff','#ffffff','#f5f5f5','#ffffff','#f4f3ef','#ffffff'], //控制每个section的背景颜色 verticalcentered: false, //内容是否垂直居中(默认为true) anchors:['page1','page2','page3','page4','page5','page6','page7'], //定义锚链接(值不能和页面中任意的id或name相同,尤其是在ie下,定义时不需要加#) navigation:true, menu:true, slidesnavigation:true, afterload: function(anchorlink, index){ function nav_show(){ $('.navmenu1').addclass("hide"); if(bg_open==false)$('.toplink').addclass("abcdefg"); } function nav_hide(){ $('.navmenu1').removeclass("hide"); $('.toplink').removeclass("abcdefg"); $('.navicon .menu').removeclass('cross'); $('.navmenu1_bg').removeclass('open',function(){ bg_open=false; }); $('.navmenu1 #menu').removeclass('expanded'); /*$('.navmenu1 #menu').removeclass('expanded'); $('.navmenu1_bg').removeclass('open');*/ } if(index == 1){ nav_hide(); }else{ nav_show(); } $(".active .go-down").animate({opacity:'1'},500,'easeinoutcubic'); $('.active [data-animation]').each(function() { var element = $(this); element.addclass('animated'); element.appear(function() { var delay = ( element.data('delay') ? element.data('delay') : 1 ); if( delay > 1 ) element.css('animation-delay', delay + 'ms'); element.addclass( element.data('animation') ); settimeout(function() { element.addclass('visible'); }, delay); }); }); }, onleave: function(index, direction){ $(".active .go-down").animate({opacity:'1'},500,'easeinoutcubic'); $('[data-animation]').each(function() { var element = $(this); element.addclass('animated'); }); }, }); //} //点击菜单导航显示 /*$('.showmenu').on('click', function() { $('.navbox1').toggleclass('expanded'); $('.showmenu').toggleclass('close'); $('.navmenu1 #menu').toggleclass('expanded'); $('.navmenu1_bg').toggleclass('open'); });*/ $('.navicon').on('click', function() { $('.navbox1').toggleclass('expanded'); $('.navicon .menu').toggleclass('cross'); $('.navbg').toggleclass('open'); $('.toplink').toggleclass("abcdefg"); $('.showmenu').toggleclass('close'); $('.navmenu1 #menu').toggleclass('expanded'); $('.navmenu1_bg').toggleclass('open'); if($('.navmenu1_bg').height()>0){ bg_open=true; } }); //第一屏banner /*$('.banner').flexslider({ animation: "fade", easing:"swing", slideshowspeed: 6000, animationspeed: 0, pauseonaction: false, directionnav:false, controlnav:true }); //新闻滚动 var owl_news = $('.newsbox'); owl_news.owlcarousel({ loop:true, responsive:{ 0:{ items:1, }, 768:{ items:3, }, 1200:{ items:3, } } }); $(".news .next").click(function(){ owl_news.trigger('next.owl.carousel'); }); $(".news .prev").click(function(){ owl_news.trigger('prev.owl.carousel'); }); //内页导航跟随 $(window).scroll(function () { var windowtop=$(window).scrolltop(); if(windowtop>0){ $("header").addclass("topfix"); $('.top_bg').addclass("topfix"); }else{ $("header").removeclass("topfix"); $('.top_bg').removeclass("topfix"); }; }); */ //所有进入特效 $('[data-animation]').each(function() { var element = $(this); element.addclass('animated'); element.appear(function() { var delay = ( element.data('delay') ? element.data('delay') : 1 ); if( delay > 1 ) element.css('animation-delay', delay + 'ms'); element.addclass( element.data('animation') ); settimeout(function() { element.addclass('visible'); }, delay); }); }); //关于我们banner /*$('.about_banner').flexslider({ animation: "fade", easing:"swing", slideshowspeed: 6000, animationspeed: 0, controlnav:false, customdirectionnav: $(".custom-navigation a"), start: function(){ var slider=$('.about_banner').data('flexslider'); $('.about_banner .about_banner_num1').html(1); $('.about_banner .about_banner_num').html(slider.count); },after: function(){ var slider=$('.about_banner').data('flexslider'); //writeobj(slider); $('.about_banner .about_banner_num1').html(slider.currentslide+1); $('.about_banner .about_banner_num').html(slider.count); },end: function(){ var slider=$('.about_banner').data('flexslider'); $('.about_banner .about_banner_num1').html(1); $('.about_banner .about_banner_num').html(slider.count); } });*/ /*var step = 0, o = 0; function changeabnav(){ $('.av-img li').stop(true,true).fadeout(800).eq(step).stop(true,true).fadein(500); $('.av-tx li').hide().eq(step).show(); }; changeabnav(); $('.av-nav a').mouseenter(function(){ step = $(this).index(); if(o!=step){changeabnav();}; o = step; }); $(".ab-nav a").click(function(){ var $this = $(this); var hash = $this.attr("href").split("#")[1]; if(hash && $("#"+hash).length>=1){ $("html,body").animate({ scrolltop: $("#"+hash).offset().top},800); } }); //数字 $(".count-number").appear(function(){ $(this).each(function(){ datacount = $(this).attr('data-count'); $(this).find('.counter').delay(1000).countto({ from: 1, to: datacount, speed: 6000, refreshinterval: 100, }); }); }); //点击查看 $(".content-more .more").click(function(){ if(!ismobile){ $(".about_about .content").animate({height:"700px"}); }else if(!mobile){ $(".about_about .content").animate({height:"20%"}); }else{ $(".about_about .content").animate({height:"1000px"}); } }); //发展历程上下颠倒效果 var owl = $('#licheng_ul'); owl.owlcarousel({ loop:false, horizontalradius: 300, pagination:false, smartspeed:500, pagination:false, responsive:{ 0:{ items:1, }, 768:{ items:2, }, 1200:{ items:4, } } }); $(".licheng .next").click(function(){ owl.trigger('next.owl.carousel'); }); $(".licheng .prev").click(function(){ owl.trigger('prev.owl.carousel'); }); $('.licheng_ul .owl-item').each(function() { var index = parseint($(this).index()) + 1 var a = index % 2 if (a == 0) { $('.licheng_dec').eq(index - 1).addclass('licheng_dec_bottom') $('.licheng_year').eq(index - 1).addclass('licheng_year_top') } else { $('.licheng_dec').eq(index - 1).addclass('licheng_dec_top') $('.licheng_year').eq(index - 1).addclass('licheng_year_bottom') } }).mouseenter(function() { $(this).addclass('cur').siblings().removeclass('cur') }); var index=$(".lichengbox .licheng_ul .owl-item").length-1 $(".lichengbox .licheng_ul .owl-item").eq(index).addclass("last_nianfen") $(".lichengbox .licheng_ul .owl-item").eq(0).addclass("first_nianfen") //荣誉资质 var owl_honor = $('.honor-owl'); owl_honor.owlcarousel({ loop:true, //horizontalradius: 300, pagination:false, smartspeed:500, margin:20, responsive:{ 0:{ items:1, nav:false }, 768:{ items:2, nav:false }, 1200:{ items:3, } } }); $(".honorbox .next").click(function(){ owl_honor.trigger('next.owl.carousel'); }); $(".honorbox .prev").click(function(){ owl_honor.trigger('prev.owl.carousel'); }); //footer $(window).scroll(function () { if ($(document).scrolltop() + $(window).height() >= $(document).height() - 150) { if(!ismobile){ $('#footer').css("display",'block'); $('#footer').delay(200).animate({bottom:0,opacity:1},800,'easeinoutcubic'); } } }); //跟随导航 $(window).scroll(function () { if ($(document).scrolltop() > 400) { $('.am-sticky-placeholder').css("display",'block'); }else if($(document).scrolltop() < 900) { $('.am-sticky-placeholder').css("display",'none'); } }); //公司图片 var owl_tupian = $('.tupianbox'); if(!ismobile){ var tpwidth = (w_width/3); }else{ var tpwidth = 0; } //console.log(tpwidth); owl_tupian.owlcarousel({ stagepadding: tpwidth, center: true, loop:true, margin:0, pagination:false, smartspeed:500, autoplay:false, autoplaytimeout:3000, autoplayhoverpause:true, responsive:{ 0:{ items:1 }, 600:{ items:1 }, 1200:{ items:1 } } }); $(".tupian .next").click(function(){ owl_tupian.trigger('next.owl.carousel'); }); $(".tupian .prev").click(function(){ owl_tupian.trigger('prev.owl.carousel'); }); //产品滚动 var owl_product = $('.product_box'); owl_product.owlcarousel({ stagepadding: 0, loop:true, margin:20, pagination:false, smartspeed:500, responsive:{ 0:{ items:1 }, 600:{ items:1 }, 700:{ items:2 }, 1000:{ items:3 }, 1200:{ items:4 } } }); $(".product_list .next").click(function(){ owl_product.trigger('next.owl.carousel'); }); $(".product_list .prev").click(function(){ owl_product.trigger('prev.owl.carousel'); }); */ //手机 //$('.mobilenav_bg').css('height',d_height); $('.mobileheader .navicon').click(function() { $('.mobilenav').addclass('showbox'); $('.mobilenav_bg').stop().fadein(); }); $('.mobilenav .mobilenav_close').click(function() { $('.mobilenav').removeclass('showbox'); $('.mobilenav_bg').stop().fadeout(); }); $('.mobilenav_bg').click(function(){ $('.mobilenav').removeclass('showbox'); $('.mobilenav_bg').stop().fadeout(); }); $(window).resize(function(){ pagebox(); //$('.product_banner').height(w_height); //$('.product_list').height(w_height); }); //自定义tap $(document).on("touchstart", function (e) { if (!$(e.target).hasclass("disable")) $(e.target).data("ismoved", 0); }); $(document).on("touchmove", function (e) { if (!$(e.target).hasclass("disable")) $(e.target).data("ismoved", 1); }); $(document).on("touchend", function (e) { if (!$(e.target).hasclass("disable") && $(e.target).data("ismoved") == 0) $(e.target).trigger("tap"); }); $('.product_banner').height(w_height); //$('.product_list').height(w_height); });