//平滑滚动到顶部
toTop = {
init:function(){
document.getElementById("toTop").onclick=function(e){
toTop.set();
return false;
}
},
waitTimer:null,
set:function(){
var d_st=document.documentElement.scrollTop;
if(window.navigator.userAgent.indexOf("MSIE")>=1){
for (var i=d_st; i>10; i-=Math.floor(i/6)){
window.scrollTo(0,i);
}
window.scrollTo(0,10);
}
else{
window.scrollTo(0,Math.floor(d_st / 2));

 if(d_st>10){
 waitTimer=setTimeout("toTop.set()",40);
  }
else{
  clearTimeout(waitTimer);
}
}
}
}
window.onload = function(){toTop.init();}
lastScrollY=0;
function heartBeat(){ 
var diffY;
if (document.documentElement && document.documentElement.scrollTop)
    diffY = document.documentElement.scrollTop;
else if (document.body)
    diffY = document.body.scrollTop
else
    {/*Netscape stuff*/}percent=.1*(diffY-lastScrollY); 
if(percent>0)percent=Math.ceil(percent); 
else percent=Math.floor(percent); 
document.getElementById("full").style.top=parseInt(document.getElementById("full").style.top)+percent+"px";lastScrollY=lastScrollY+percent; 
}
document.write("<style type='text/css'>#full{background:#FFF url(images/qq_bottom.gif) no-repeat center bottom;width:82px;overflow:hidden;text-align:center;font-size:12px;border-left:1px #963072 solid;border-right:1px #963072 solid;color:#963072;}#full .qq_top{background:url(images/qq_top.gif) no-repeat center top;height:41px;}.qq_top a#toTop{height:34px;display:block;outline:none;blr:expression(this.onFocus=this.blur());}#full .qq_bottom{height:3px;font-size:0}#full ul{margin:0;padding:0;list-style:none}#full li{}#full span{display:block;height:16px;line-height:16px;margin-bottom:6px;}#full img{CURSOR:pointer;border:0;width:77px;height:20px;padding-bottom:10px;}</style>");
document.write("<div id=\"full\" style='right:0px;top:180px;position:absolute;z-index:1000;'>");
/*上面里面的top:180px表示滚动距离上面的初始高度,可以改动180这个值的大小来控制浮动QQ距上面的宽度*/
document.write("<ul><div class=\"qq_top\"><a id='toTop' href='#top'> </a></div>");
document.write("<li><span>武昌客服</span><img onclick=\"javascript:window.open('tencent://message/?uin=6329657&amp;websiteName=www.qq.com','_self');\" src='http://wpa.qq.com/pa?p=1:6329657:1' alt='点击QQ万润交流'/></li>");
/*这一段表示的是 文字 和QQ ,如果你要添加N个QQ,就把上面的代码复制N次. 另外,上面的两个123456表示一个QQ号码,要改动QQ号码的话,两个数字都要改动*/
document.write("<div class=\"qq_bottom\"></div></ul></div>");
window.setInterval("heartBeat()",1);
/*如果QQ在线的话,它会自动的变换成亮颜色。如果不在线它会自动变成灰色。这个可以不用控制它*/

解决方案 »

  1.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <script src="qq.js"></script>
    </head><body>
    <table width="100%" height="2840" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="252" bgcolor="#66CCFF">&nbsp;</td>
        <td bgcolor="#669999">&nbsp;</td>
      </tr>
    </table>
    </body>
    </html>
      

  2.   

    学习  我做的网站中也用到了 QQ漂浮www.linsenshengwu.com 如果想要可以发给你
      

  3.   

    有点像QQ爱墙 我有php 程序 不知楼主需要吗?是DIV 的 
      

  4.   

    google搜一下其他可以在w3c下正常显示的,,你那不代码不符合w3c标准的