试题_08年阿里巴巴前端面试题
2009-12-07 22:52
399 查看
无意中看到此题,做一下玩玩:
HTML:
js:
HTML:
<style> *{ margin:0; padding:0;} .box { position:relative; width:315px; height:279px;} #box1,#box2,#box3 { background-color:#CDD8DA; text-align:center; font-weight:bold;} #box1 { position:absolute; left:0; top:0; width:90px; height:153px; line-height:153px;} #box2 { position:absolute; left:0; bottom:0; width:90px; height:119px; line-height:119px;} #box3 { position:absolute; right:0; bottom:0; width:217px; height:279px; line-height:279px;} </style> <body> <div class="box"> <div id="box1">A</div> <div id="box2">B</div> <div id="box3">C</div> </div> </body> </html>
js:
function hoverBig(x){ var x = document.getElementById(x); var w = x.clientWidth; var h = x.clientHeight; var bW = Math.floor( w * 1.25 ); var bH = Math.floor( h * 1.25 ); x.onmouseover = function(){ x.style.backgroundColor = "#DDF8C0"; x.style.width = bW + "px"; x.style.height = bH + "px"; x.style.zIndex = 100; } x.onmouseout = function(){ x.style.backgroundColor = "#CDD8DA"; x.style.width = w + "px"; x.style.height = h + "px"; x.style.zIndex = 1; } } hoverBig("box1"); hoverBig("box2"); hoverBig("box3");
相关文章推荐
- 【JS每日练习】阿里巴巴web前端开发面试题
- 阿里巴巴前端面试题:三列布局知多少?
- 阿里巴巴前端岗位面试题
- 阿里巴巴前端面试题
- 一道阿里巴巴web前端面试题拓展
- [面试题] 2010~2011年度搜狐、腾讯、网易、淘宝、阿里巴巴、百度等多家名企Web前端开发面试题!
- 阿里巴巴Web前端开发面试题赋答案
- 阿里巴巴 前端面试题
- 阿里巴巴前端面试parseInt()函数的面试题
- 2014阿里巴巴web前端实习生试题分析(1)
- 阿里巴巴Web前端开发面试题赋答案
- 阿里巴巴前端面试parseInt()函数的面试题
- 阿里巴巴前端面试题:parseInt解析
- 阿里巴巴2014实习生前端招聘在线笔试题
- 【前端笔试/面试题】1
- BAT及各大互联网公司2014前端笔试面试题:HTML/CSS篇
- 前端面试题汇总
- 为什么镜子里的影像左右颠倒而不是上下颠倒 - Google, 谷歌,百度,baidu,阿里巴巴,alibaba,微软,华为,huawei面试题
- 如果在高速公路上30分钟内到一辆车开过的几率是0.95,那么在10分钟内看到一辆车开过的几率是多少 (假设为常概率条件下) - Google, 谷歌,百度,baidu,阿里巴巴,alibaba,微软,华为,huawei面试题,
- github前端面试题1