困&无聊,写个javascript

我也不知道这是虾米碗糕,反正就是困得无聊,随便写写。

效果看这里:随便玩玩

代码如下:

<html>
<head>
<title> 随便玩玩 </title>
<script type=”text/javascript”>
<!–
function gogogo(){
 var w=window;
 function g(i){return w.document.getElementById(i);}

 var f=g(‘playframe256xszfsa’);

 function mkTrack(n,d,s){
  var i, j, node;
  var x, y;
  with (d.style){
   width=height=(n+1)*(s+1)+1;
  }
  for (i=0; i<4; i++){
   for (j=0; j<n; j++){
    node=w.document.createElement(‘div’);
    node.id=’o’+(n*i+((i<2)?j:n-1-j));
    x=((i%2==0)?(j+(2-i)/2)*(s+1):(3-i)*n*(s+1)/2)+d.offsetLeft;
    y=((i%2==1)?(j+(3-i)/2)*(s+1):i*n*(s+1)/2)+d.offsetTop;
    setStyle(node,x,y,s);
    d.appendChild(node);
   }
  }
 }

 function setStyle(n,x,y,s){
  with (n.style){
   width=s+’px’;
   height=s+’px’;
   border=’1px solid #abc’;
   backgroundColor=’#def’;
   margin=1;
   position=’absolute’;
   left=x;
   top=y;
   overflow=’hidden’;
  }
 }

 function hitIt(i,s,t,c){
  g(‘o’+i).style.backgroundColor=c;
  s*=4;i+=s;i–;i%=s;
  g(‘o’+i).style.backgroundColor=’#def’;
  i+=2;i%=s;
  setTimeout(function(){hitIt(i,s/4,t,c);}, t);
 }

 function flash(o,t){
  var i=0;
  var timer=setInterval(function(){
   if(i%2==0)o.style.backgroundColor=’#325′;
   else o.style.backgroundColor=’#fff’;
   i++;
   if(i>7)clearInterval(timer);
  },80)
  setTimeout(function(){flash(o,t);}, t);
 }

 function showHelp(c1,c2){
  if(g(‘help’).innerHTML==c1)
   g(‘help’).innerHTML=c2;
  else
   g(‘help’).innerHTML=c1;
  setTimeout(function(){showHelp(c1,c2);},3000);
 }

 w=window.open(”, ‘playframe256xszfsa’);
 w.document.body.innerHTML='<div id=”playzone” style=”border: 1px solid yellow”><div id=”help” style=”color:  #aaa; font-size: 14px; text-align: center; margin: 20px”></div></div>’;
 var s=20, n=10;
 with(w.document.body.style){
  margin=0;
  overflow=’hidden’;
  border=0;
 }
 with(f.style){
  display=’block’;
  border=0;
  width=height=(n+1)*(s+1)+3;
 }
 mkTrack(s,g(‘playzone’),n);
 hitIt(5,s,10,’blue’);
 hitIt(0,s,10,’red’);
 flash(g(‘playzone’),2000);
 showHelp(‘救命啊!!!’, ‘你是跑不掉滴,hiahia~~’);
}
//–>
</script>
</head>

<body>
<iframe id=”playframe256xszfsa” name=”playframe256xszfsa” onload=”gogogo()” style=”display: none” src=”about:blank”></iframe>
</body>
</html>

— EOF —

《困&无聊,写个javascript》有10个想法

  1. I would like to thank you for the efforts you have put in writing this blog. I am hoping the same high-grade web site post from you in the upcoming also. In fact your creative writing skills has encouraged me to get my own blog now. Actually the blogging is spreading its wings fast. Your write up is a good example of it.

  2. Sex unter Frauen soll ja unglaublich zärtlich sein, was der Regel dazu führt, dass es eine wahre Orgasmusorgie gibt wenn zwei Lesben sich gegenseitig ihre nassen Muschis auslecken.

发表评论

电子邮件地址不会被公开。 必填项已用*标注