码迷,mamicode.com
首页 > 其他好文 > 详细

for循环坐标生成《逢五向上转》

时间:2017-05-25 13:37:11      阅读:126      评论:0      收藏:0      [点我收藏+]

标签:round   color   ack   doctype   html   document   inner   get   type   

<!DOCTYPE html>
<html>
 <head>
  <meta charset="UTF-8">
  <title></title>
  <title></title>
  <style type="text/css">
  div{
  width: 50px;
  height: 50px;
  background-color: red;
  position: absolute;
  top: 0;
  left: 0;
  line-height: 50px;
  text-align: center;
  }
  </style>
  
  <script type="text/javascript">
    window.onload=function (){
  for(var i=0;i<11;i++){
  document.body.innerHTML+=‘<div>‘+i+‘</div>‘;
  }
  var aDiv=document.getElementsByTagName("div");
  for(var j=0;j<6;j++){
  aDiv[j].style.left=j*50+‘px‘;
  aDiv[j].style.top=j*50+‘px‘;
  }
  for(var z=6;z<11;z++){
  aDiv[z].style.left=z*50+‘px‘;
  aDiv[z].style.top=(10-z)*50+‘px‘;
  }
  }
 
</script>
 </head>
 <body>
 </body>
</html>

for循环坐标生成《逢五向上转》

标签:round   color   ack   doctype   html   document   inner   get   type   

原文地址:http://www.cnblogs.com/xuling123/p/6902892.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!