ie6 js 固定不动
下面 其中 ser_qq 为某个元素 它是绝对定位的
<script language="javascript">
var tips;
var theTop = 40;
var old = theTop;
function initFloatTips()
{
tips = document.getElementById('ser_qq');
moveTips();
}
function moveTips()
{
var tt=50;
if (window.innerHeight)
{
pos = window.pageYOffset
}else if (document.documentElement && document.documentElement.scrollTop) {
pos = document.documentElement.scrollTop
}else if (document.body) {
pos = document.body.scrollTop;
}
pos=pos-tips.offsetTop+theTop;
pos=tips.offsetTop+pos/10;
if (pos < theTop){
pos = theTop;
}
if (pos != old) {
tips.style.top = pos+"px";
tt=10; //alert(tips.style.top);
}
old = pos;
setTimeout(moveTips,tt);
}
initFloatTips();
</script>