2012年12月20日星期四

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

<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> 

没有评论: