var ai=0; function add(ai){ var tbox =$(".tbox"); var tiao =$(".tiao"); tiao.html(ai+"%"); } function xh(){ if(ai>100){ $('.load-box').fadeout(); return; } if(ai<=100){ settimeout("xh()",100) add(ai); ai++; } } $(window).ready(function(){ xh(); }); $(function(){ headh() $(window).resize(function(){ headh() }) $(window).load(function(){ var n = $(".tbox").length; if (n < 1) { $('.load-box').fadeout(); }; }) $(window).scroll(function(){ var win = $(window).scrolltop(); $('.flex-b').each(function(){ var fis = $(this).offset().top; if ($(window).width() < 1025) { var tt = ($(window).scrolltop() - $(this).offset().top)/8; $(this).find('.flex-pic').stop().animate({top:tt},0); }else{ var tt = ($(window).scrolltop() - $(this).offset().top)/4.5; $(this).find('.flex-pic').stop().animate({top:tt},0); } }) if ($('.scroll-top').length >0) { var top = $('.scroll-top').offset().top; }else{ var top = 0 } if (win > top) { $('.product-none').show(); $('.product-nav').addclass('fex').stop().animate({top:0},300); }else{ $('.product-none').hide(); $('.product-nav').removeclass('fex').removeattr('style'); } }) $('header .tit').on('click',function(){ if ($(this).hasclass("on")) { $(this).removeclass("on"); $('header.the').removeclass("on"); $('.nav-box').hide(); $('.nav-box .nav-list-box').slideup(300,function(){ $('.nav-box .bg').fadeout(); }); }else{ $(this).addclass("on"); $('header').removeclass('one'); $('header.the').addclass("on"); $('.nav-box').show(); $('.nav-box .nav-list-box').slidedown(); $('.nav-box .bg').fadein(); } }) $('.nav-box .bg').on('click',function(){ $('header .tit').removeclass("on"); $('.nav-box').hide(); $('.nav-box .nav-list-box').slideup(300,function(){ $('.nav-box .bg').fadeout(); }); }) function headh(){ var winh = $(window).height(); var winw = $(window).width(); var htmlh = $('html,body').height(); var heg = $('header').height(); $('.load-box').width(winw); $('.load-box').height(winh); $('header .logo,header .nav-list').css('line-height',heg+'px'); $('header .bdsharebuttonbox,header .nav-list').css('height',heg+'px'); if (winw > 1024) { $('.i-ban .slides li').height(winh) }; $('.nav-box').css({ 'height':htmlh - heg, 'top':heg, }) } });