阿里应聘答题

(本文于2008-01-16书写)

今天在我们的最大的对手alibaba那应聘了一下.

有点感觉.....恩!  看来他们越来越重视用户体验了.face2.gif

我来发一下我的答案:  献丑emsmile.gif

<html>
  <head>
    <title>Project</title>
  </head>
  <style type="text/css">
  body{ margin:0px; padding:0px; text-align:center;
  }
  #body-box { margin:auto; width:970px; position:relative;
  }
  #left { float:left; width:300px; height:500px; text-align:left;
  }
  #left-top { width:290px; height:250; margin-bottom:10px; background-color:#000000;
  }
  #left-bottom { width:290px; height:240px; background-color:#999999;
  }
  #right { float:left; width:600px; height:500px; background-color:#003399;
  }
  #float-box { position:absolute; width:0px; height:0px; top:0px; left:0px; background-color:#FF0000;
  }
  </style>
  <script language="javascript">
  function DivChange(dObject)
  {
   var dfloat = document.getElementById("float-box");
   dfloat.innerHTML = dObject.innerHTML;
   dfloat.style.width = PxToInt(dObject.style.width)*1.25;
   dfloat.style.height = PxToInt(dObject.style.height)*1.25;
   dfloat.style.top = GetTop(dObject);
   dfloat.style.left = GetLeft(dObject);
  }
  function PxToInt(px)
  {
     var ponter = 0;
  px = px.toString(10);
  while(px.length > ponter)
  {
         var strTemp = px.substr(ponter,1);
   if(strTemp == ".")
   {
    return parseInt(px.substr(0,ponter));
   }
   ponter++;
  }
  return parseInt(px);
  }
  function GetTop(dObject)
  {

   if(dObject.id =="left-top")
   { 
       return "0px";
   }
   if(dObject.id == "left-bottom")
   {
      
       return PxToInt(document.getElementById("left-top").style.height);
   }
   if(dObject.id == "right")
   {
       return "0px";
   }
  }
  function GetLeft(dObject)
  {
      if(dObject.id == "left-top")
   {
       return "0px";
   }
   if(dObject.id == "left-bottom")
   {
       return "0px";
   }
   if(dObject.id == "right")
   {
       return PxToInt(document.getElementById("left-top").style.width)+10;
   }
  }
  </script>
  <body>
    <div id="body-box">
   <div id="left">
     <div id="left-top" οnclick="DivChange(this)" style="width:290px; height:250;">1</div>
  <div id="left-bottom" οnclick="DivChange(this)" style="width:290px; height:240px;">2</div>
   </div>
   <div id="right" οnclick="DivChange(this)" style="width:600px; height:500px;">3</div>
   <div id="float-box"></div>
 </div>
  </body>
</html>

转载于:https://www.cnblogs.com/zhou5791759/archive/2008/10/12/1309072.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值