聘我网

新概念招聘3.0

悬停效果 静止不动 不随滚动条滚动 纯css实现

vote up0vote downstar
<style>  
.aa{
    height:2000px;
    width:40px;
    background:#eee;
    }  
.bb{
    width:50px;
    height:80px;
    background:red;
  float:right;  
  position:fixed !important; top/**/:0px;   
  position:absolute;
    z-index:100;
  top:expression(offsetParent.scrollTop+20);
    right:20px;
    }
</style>   
    <div class="aa">  
       我是不动的。   
      <script>for(var i=0;i<99;i++){document.write(i+"<br>");}</script>            

          <div class="bb">move</div>  

    </div> 
 
expression的开销比较大,追求性能的话不要轻易用它。 - Shore 2009-11-10, 11:05

您的回答





不是您要找的问题? 浏览其他含有标签 的问题或者 自己问个.