$(function(){ //home $(window).resize(function(){ var ww=$(window).width(); var wh=$(window).height(); var aboutli=$(".abouttit ul li").width(); var aboutlileng=$(".abouttit ul li").length; if(ww <= 768){ $(".nav").css({"max-height":wh-80}); $(".abouttit ul").width((aboutli+6)*aboutlileng+'px'); } }).resize(); $(window).scroll(function() { animat(); }) //nav // $(window).scroll(function() { // var stop=$(window).scrolltop(); // if(stop < 100){ // $(".top").show(); // $(".navwraptop").stop().animate({"top":'-100px'},500); // }else{ // $(".top").fadeout(); // $(".navwraptop").stop().animate({"top":'0'},800); // }; // }) // // banner //wap-nav var wapnav=function(){ $(".navbtn").click(function(){ $(".navbtn").stop().removeclass("on"); $(".submenu").stop().slideup(); $(this).stop().toggleclass("on"); $(this).stop().siblings(".submenu").slidetoggle() }) var i=0; $(".menu").click(function(){ if(i==0){ //$(this).parents(".navwrap").find(".nav").stop().animate({"right":'0'}); i=1; }else if(i==1){ //$(this).parents(".navwrap").find(".nav").stop().animate({"right":'-220px'}); i=0; } }) $(window).scroll(function() { //$(".nav").stop().animate({"right":'-220px'}); i=0; }) $(".nav").scroll(function(event){ event.stoppropagation(); }) } //page var page=function(){ $(".page a").click(function(){ $(this).addclass("active").siblings(".page a").removeclass("active"); $(this).parent(".page").find("em").removeclass("active"); $(this).parent(".page").find("i").removeclass("active"); }) $(".page em").click(function(){ $(this).addclass("active").siblings(".page em").removeclass("active"); $(this).parent(".page").find("i").removeclass("active"); }) $(".page i").click(function(){ $(this).addclass("active").siblings(".page i").removeclass("active"); $(this).parent(".page").find("em").removeclass("active"); }) } //donghua var animat = function() { var stop = $(window).scrolltop(); var he = $(window).height(); function use(ele) { ele.each(function() { var eoffset = $(this).offset().top; if (stop + he > eoffset) { $(this).stop().animate({ "top": "0px", "opacity": "1" }, 600) } }) } use($(".notice ul li,.homenews,.homenewslist li, .homeinfor .pic, .homeinfor .right, .homeinforbottom, .homecom, .homejt, .homecyqy .wrap, .bottom, .footer, .abouttit")); use($(".animate")); // use($(".homenewslist li")); } wapnav(); page(); //page animat(); //donghua })