用户注册



邮箱:

密码:

用户登录


邮箱:

密码:
记住登录一个月忘记密码?

发表随想


还能输入:200字
云代码 - javascript代码库

js 自动网页高度+样式表四季自动切换

2013-10-29 作者: 免费源代码下载整理举报

[javascript]代码库

var g=function(o){
    return document.getElementById(o)
}
,
w=g("wrap"),f=g("footer"),b=document.body,
host=window.location.host.split("."),n=host[0],
s={
    "1":"winter","2":"winter","3":"spring","4":"spring","5":"spring","6":"summer","7":"summer","8":"summer","9":"autumn","10":"autumn","11":"autumn","12":"winter"
}
[(new Date(nowtime*1000)).getMonth()+1],
h=document.documentElement.clientHeight||b.clientHeight,
a=function(){},
set=function(){
    if(h>=690){
        w.style.paddingTop=Math.ceil((h-570)/2)+"px";
        f.className="footer pa"
     
    }
    else{
        w.style.paddingTop="60px";
        f.className="footer"
     
    };
}
,
int=function(){
    if(host.length==4){
        if(n=="app"||n=="game"){
            n=host[1]
        }
        else{
            n=host[0]+"."+host[1]
        }
    };
    g("return").href="http://"+n+".qq.com/?ADTAG=IED.InnerCop.gameWeb.errPage";
    g("i404").src="http://ossweb-img.qq.com/images/game/404/season-"+s+".jpg";
    b.className=s;
    set();
    b.style.display="block";
    a("resize",function(){
        h=document.documentElement.clientHeight||b.clientHeight;
        set();
    });
};
if(window.attachEvent){
    a=function(e,f){
        window.attachEvent("on"+e,f)
    }
}
else{
    a=function(e,f){
        window.addEventListener(e,f,false)
    }
};
if(typeof(pgvMain)=="function"){
    pgvMain()
};
int();


网友评论    (发表评论)


发表评论:

评论须知:

  • 1、评论每次加2分,每天上限为30;
  • 2、请文明用语,共同创建干净的技术交流环境;
  • 3、若被发现提交非法信息,评论将会被删除,并且给予扣分处理,严重者给予封号处理;
  • 4、请勿发布广告信息或其他无关评论,否则将会删除评论并扣分,严重者给予封号处理。


扫码下载

加载中,请稍后...

输入口令后可复制整站源码

加载中,请稍后...