浮动层固定位置的方法

  1. var $ = document.getElementById;
  2. var $$ = document.documentElement;
  3. function fixDiv(id){
  4.     $(id).style.top = ($$.scrollTop + $$.clientHeight - $(id).clientHeight - 20) + "px";
  5.     setTimeout("fixDiv('newYear')",2);
  6. }
  7. fixDiv('newYear');
posted @ 2008-09-23 14:36  looping  阅读(933)  评论(1编辑  收藏  举报