QQ在线客服代码演示-asp源代码

  昨天在用ASP实现添加类似“QQ在线客服”功能的模块时遇到一个问题:功能基本上实现了但是对话框不跟着滚动条一起滚动,把代码仔细研究之后终于发现问题了,哈哈、、、、 其实就出在第一行,在dreamweaver 8.0里面直接新建一个HTML文件时代码里面的第一行为<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">,哦,对了,默认的时候为<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">,仔细对照下面的源代码之后才知道问题就出在多了 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd",把它删除就OK了。

下面的ASP代码直接复制就可以运行:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>QQ在线客服代码演示</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.3790.4186" name=GENERATOR></HEAD>
<BODY>
<DIV id=divStay style="POSITION: absolute">
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
    <TD vAlign=top width="7%"> </TD></TR></TBODY></TABLE></DIV>
<SCRIPT language=javascript>
function picsize(obj,MaxWidth){
  img=new Image();
  img.src=obj.src;
  if (img.width>MaxWidth)
  {
    return MaxWidth;
  }
  else
  {
    return img.width;
  }
}
function CloseQQ()
{
divStayTopleft.style.display="none";
return true;
}
var online= new Array();
</SCRIPT>
<DIV id=divStayTopleft style="POSITION: absolute">
<TABLE cellSpacing=0 cellPadding=0 width=109 border=0>
  <TBODY>
  <TR>
    <TD colSpan=3><A οnclick=CloseQQ() href="javascript:;" shape=circle
      coords=91,16,12><IMG height=34 src="index_files/qq_top.gif" width=109
      useMap=#Map border=0></A></TD></TR>
  <TR>
    <TD width=6><IMG height=100 src="index_files/qq_life.gif" width=6></TD>
    <TD vAlign=top width=96 background="">
      <TABLE cellSpacing=0 cellPadding=0 width=90 align=center border=0>
         <TBODY>
        <TR>
          <TD height=30>
            <TABLE cellSpacing=0 cellPadding=0 width=90 border=0>
              <TBODY>
              <TR>
                <TD><IMG height=13 src="index_files/qq_ico1.gif"
                  width=16><SPAN class=font_12> <SPAN
                  style="FONT-SIZE: 9pt">客户服务</SPAN></SPAN></TD></TR></TBODY></TABLE></TD></TR>
        <TR>
          <TD>
            <TABLE id=table47 cellPadding=2 width="100%" border=0>
              <TBODY>
              <TR>
                <TD vAlign=top width=15 height=23><IMG height=16
                  src="index_files/qq_v01.gif" width=16 border=0></TD>
                <TD vAlign=bottom>
                  <SCRIPT>document.write("<a target=blank href=tencent://message/?uin=178010108&Site=阿里西西&Menu=yes><img border=0 SRC=http://wpa.qq.com/pa?p=1:615050000:10 alt=[阿里西西]></a>");</SCRIPT>
                </TD></TR></TBODY></TABLE></TD></TR>
        <TR>
          <TD></TD></TR>
        <TR>
          <TD>
            <TABLE id=table47 cellPadding=2 width="100%" border=0>
              <TBODY>
              <TR>
                <TD vAlign=top width=15 height=23><IMG height=16
                  src="index_files/qq_n01.gif" width=16 border=0></TD>
                <TD vAlign=bottom>
                  <SCRIPT>document.write("<a target=blank href=tencent://message/?uin=178160088&Site=网页特效&Menu=yes><img border=0 SRC=http://wpa.qq.com/pa?p=1:43486831:10 alt=[特效代码]></a>");</SCRIPT>
                </TD></TR></TBODY></TABLE></TD></TR>
        <TR>
          <TD></TD></TR></TBODY></TABLE></TD>
    <TD width=7><IMG height=100 src="index_files/qq_right.gif" width=7></TD></TR>
  <TR>
    <TD colSpan=3><IMG height=30 src="index_files/qq_bottom1.gif"
  width=109></TD></TR>
  <TR>
    <TD colSpan=3><IMG height=33 src="index_files/qq_logo.gif"
  width=109></TD></TR></TBODY></TABLE></DIV>
<SCRIPT type=text/javascript>
function FloatTop()
{
var startX1 =document.body.offsetWidth-125 ,startY1 = 5;
var startX2 =0,startY2 = 95;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id,startX,startY)
{
  var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
  if(d.layers)el.style=el;
  el.sP=function(x,y){this.style.left=x;this.style.top=y;};
  el.x = startX;
  el.y = startY;
  return el;
}
window.stayTopLeft=function()
{
  var pY = ns ? pageYOffset : document.body.scrollTop;
  ftlObj.y += (pY + startY1 - ftlObj.y)/8;
  ftlObj1.y += (pY + startY2 - ftlObj1.y)/8;
  ftlObj.sP(document.body.scrollLeft+document.body.offsetWidth-125, ftlObj.y);
  ftlObj1.sP(ftlObj1.x, ftlObj1.y);
  setTimeout("stayTopLeft()", 30);
}
//  ftlObj = ml("divStay",document.body.scrollLeft+document.body.offsetWidth-125,0);
//  ftlObj1 = ml("divStayTopLeft",0,30);
ftlObj = ml("divStay",(document.body.scrollLeft+document.body.offsetWidth)/2+379,0);
ftlObj1 = ml("divStayTopLeft",(document.body.scrollLeft+document.body.offsetWidth)/2+379,30);
stayTopLeft();
}
FloatTop();
</SCRIPT>
<!--End: QQ在线客服 -->
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P></P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P></P>
</BODY></HTML>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值