[JavaScript] js 自动网页高度+样式表四季自动切换 →→→→→进入此内容的聊天室

来自 , 2020-12-05, 写在 JavaScript, 查看 173 次.
URL http://www.code666.cn/view/f95ec3de
  1. var g=function(o){
  2.         return document.getElementById(o)
  3. }
  4. ,
  5. w=g("wrap"),f=g("footer"),b=document.body,
  6. host=window.location.host.split("."),n=host[0],
  7. s={
  8.         "1":"winter","2":"winter","3":"spring","4":"spring","5":"spring","6":"summer","7":"summer","8":"summer","9":"autumn","10":"autumn","11":"autumn","12":"winter"
  9. }
  10. [(new Date(nowtime*1000)).getMonth()+1],
  11. h=document.documentElement.clientHeight||b.clientHeight,
  12. a=function(){},
  13. set=function(){
  14.         if(h>=690){
  15.                 w.style.paddingTop=Math.ceil((h-570)/2)+"px";
  16.                 f.className="footer pa"
  17.        
  18.         }
  19.         else{
  20.                 w.style.paddingTop="60px";
  21.                 f.className="footer"
  22.        
  23.         };
  24. }
  25. ,
  26. int=function(){
  27.         if(host.length==4){
  28.                 if(n=="app"||n=="game"){
  29.                         n=host[1]
  30.                 }
  31.                 else{
  32.                         n=host[0]+"."+host[1]
  33.                 }
  34.         };
  35.         g("return").href="http://"+n+".qq.com/?ADTAG=IED.InnerCop.gameWeb.errPage";
  36.         g("i404").src="http://ossweb-img.qq.com/images/game/404/season-"+s+".jpg";
  37.         b.className=s;
  38.         set();
  39.         b.style.display="block";
  40.         a("resize",function(){
  41.                 h=document.documentElement.clientHeight||b.clientHeight;
  42.                 set();
  43.         });
  44. };
  45. if(window.attachEvent){
  46.         a=function(e,f){
  47.                 window.attachEvent("on"+e,f)
  48.         }
  49. }
  50. else{
  51.         a=function(e,f){
  52.                 window.addEventListener(e,f,false)
  53.         }
  54. };
  55. if(typeof(pgvMain)=="function"){
  56.         pgvMain()
  57. };
  58. int();

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

这儿你可以回复上面这条便签

captcha