书签 分享 收藏 举报 版权申诉 / 15

类型自动弹出对话框的QQ在线客服系统代码.docx

  • 文档编号:6450062
  • 上传时间:2023-01-06
  • 格式:DOCX
  • 页数:15
  • 大小:42.53KB
';

  

 document.write(rightDivHtml);

  

 if(type==1&&kf_getCookie('hasshown')==0)

 {

   companyname=companyname.substr(0,15);      

     welcomeword=kf_processWelcomeword(welcomeword);

    

   kfguin=kf_getSafeHTML(kfguin);

   companyname=kf_getSafeHTML(companyname);

    

   welcomeword=welcomeword.replace(//g,'\r\n');

   welcomeword=kf_getSafeHTML(welcomeword);

   welcomeword=welcomeword.replace(/\r/g,"").replace(/\n/g,"
");

  

     window.setTimeout("kf_sleepShow()",2000);

     //kf_sleepShow();

 }

 window.setTimeout("kf_moveWithScroll()",1);

 //window.setInterval("wpa_count()",10000);

}

functionkf_getSafeHTML(s)

{

 varhtml="";

 varsafeNode=g_safeNode;

 

 if(!

safeNode)

 {

  safeNode=document.createElement("TEXTAREA");

 }

 if(safeNode)

 {

  safeNode.innerText=s;

  html=safeNode.innerHTML;

  safeNode.innerText="";

  

  g_safeNode=safeNode;

 }

 

 returnhtml;

}

functionkf_moveWithScroll() 

 if(typeofwindow.pageYOffset!

='undefined'){ 

       nowY=window.pageYOffset; 

    } 

    elseif(typeofpatMode!

='undefined'&&patMode!

='BackCompat'){ 

       nowY=document.documentElement.scrollTop; 

    } 

    elseif(typeofdocument.body!

='undefined'){ 

       nowY=document.body.scrollTop; 

    } 

  percent=.1*(nowY-lastScrollY);

  if(percent>0) 

  {

   percent=Math.ceil(percent);

  } 

  else

  {

   percent=Math.floor(percent);

  }

 document.getElementById("rightDiv").style.top=parseInt(document.getElementById("rightDiv").style.top)+percent+"px";

 if(document.getElementById("kfpopupDiv"))

 {

  document.getElementById("kfpopupDiv").style.top=parseInt(document.getElementById("kfpopupDiv").style.top)+percent+"px";

 }

 lastScrollY=lastScrollY+percent;

 tOut=window.setTimeout("kf_moveWithScroll()",1);

}

functionkf_hide() 

{

 if(tOut!

=-1)

 {

  clearTimeout(tOut);   

  tOut=-1;

 }

 document.getElementById("rightDiv").style.visibility="hidden";

}

functionkf_hidekfpopup()

{

 if(tOut!

=-1)

 {

  clearTimeout(tOut);   

  tOut=-1;

 }

 document.getElementById("kfpopupDiv").style.visibility="hidden";

 tOut=window.setTimeout("kf_moveWithScroll()",1);

}

functionkf_getPopupDivHtml(kfguin,reference,companyname,welcomeword)

{

  vartemp='';

  temp+='

left;height:

150px;width:

8px;background-image:

url('+urlroot+'bg_1.gif);">

';

   temp+='

Tahoma;text-align:

left;float:

left;height:

150px;width:

324px;background-image:

url('+urlroot+'bg_2.gif);background-repeat:

repeat-x;">';

   temp+='

left;font-size:

14px;color:

#FFFFFF;margin:

0px;padding:

10px013px2px;line-height:

17px;">'+companyname+'

url('+urlroot+'close.gif);float:

right;height:

19px;width:

42px;"onmouseover="javascript:

this.style.backgroundPosition=\'bottom\'"onmouseleave="javascript:

this.style.backgroundPosition=\'top\'">

';

   temp+='

83px;padding:

0002px;clear:

both;">';

   temp+='

url('+urlroot+'face.jpg);height:

70px;width:

70px;float:

left;">

';

   temp+='

Tahoma;font-size:

12px;line-height:

24px;width:

240px;margin:

0px;padding:

00012px;display:

block;float:

left;margin-top:

2px;word-wrap:

break-word;">'+welcomeword+'

';

   temp+='

both;">';

   temp+='

right;background-image:

url('+urlroot+'btn_1.gif);margin:

0005px;padding:

0px;border:

0px;height:

21px;width:

69px;">';

   temp+='

(1)"href="#"style="float:

right;background-image:

url('+urlroot+'btn_2.gif);margin:

0px;padding:

0px;border:

0px;height:

21px;width:

69px;">

';

   temp+='

left;height:

150px;width:

8px;background-image:

url('+urlroot+'bg_1.gif);background-position:

right;">

';

   returntemp;

}

functionkf_getPopupRightDivHtml(kfguin,reference)

 vartemp="";

 temp+='

90px;height:

150px;">';

 temp+='

8px;height:

150px;float:

left;background:

url('+urlroot+'bg_1.gif);">';

 temp+='

left;width:

74px;height:

150px;background:

url('+urlroot+'middle.jpg);background-position:

center;">';

 temp+='

17px;font-size:

14px;color:

#FFF;margin:

0px;padding:

10px013px8px;"> 

';

 temp+='

83px;padding:

0002px;clear:

both;">

70px;height:

70px;float:

left;background:

url('+urlroot+'face.jpg);">';

 temp+='

both;">

69px;height:

21px;background:

url('+urlroot+'btn_2.gif);margin:

0002px;display:

block;">';

 temp+='

8px;height:

150px;float:

left;background:

url('+urlroot+'bg_1.gif)right;">';

 returntemp;

}

//addedbysimon2008-11-04

functionkf_openChatWindow(flag)

{

 window.open(''_blank','height=544,width=644,toolbar=no,scrollbars=no,menubar=no,status=no');

 if(flag==1)

 {

  kf_hidekfpopup();

 }

 returnfalse;

}

//addedbysimon2008-11-04end

functionkf_validateWelcomeword(word)

{

 varcount=0;

 

 for(vari=0;i

 {

  if(word.charAt(i)=='\n')

  {

   count++;

  }

  if(count>2)

  {

    return2;

  }

 }

 if(word.length>57+2*count)

 {

  return1;

 }

 

 count=0;

 vartemp=word.indexOf('\n');

 while(temp!

=-1)

 {

  word=word.substr(temp+1); 

  if(temp-1<=19) 

  {

   count+=19;

  }

  elseif(temp-1<=38)

  {

   count+=38;

  }

  elseif(temp-1<=57)

  {

   count+=57;

  }

  

  temp=word.indexOf('\n');

 }

 count+=word.length; 

 if(count>57)

 {

  return3;

 }

  

 return0;

}

functionkf_processWelcomeword(word)

{

 word=word.substr(0,57+10);

 varresult='';

 varcount=0; 

 vartemp=word.indexOf('');

 

 while(count<57&&temp!

=-1)

 {

  if(temp<=19) 

  {

   count+=19;

   if(count<=57)

   {

     result+=word.substr(0,temp+5);

   }

   else

   {

    result+=word.substr(0,57-count>word.length?

word.length:

57-count);

   }

  }

  elseif(temp<=38)

  {

   count+=38;

   if(count<=57)

   {

     result+=word.substr(0,temp+5);

   }

   else

   {

    result+=word.substr(0,57-count>word.length?

word.length:

57-count);

   }

  }

  elseif(temp<=57)

  {

   count+=57;

   if(count<=57)

   {

     result+=word.substr(0,temp+5);

   }

   else

   {

    result+=word.substr(0,57-count>word.length?

word.length:

57-count);

   }

  }

  

  word=word.substr(temp+5); 

  temp=word.indexOf('');

 }

  

 if(count<57)

 {

     result+=word.substr(0,57-count>word.length?

word.length:

57-count);

 }

  

 returnresult;

}

functionkf_setCookie(name,value,exp,path,domain)

{

 varnv=name+"="+escape(value)+";";

 vard=null;

 if(typeof(exp)=="object")

 {

  d=exp;

 }

 elseif(typeof(exp)=="number")

 {

  d=newDate();

  d=newDate(d.getFullYear(),d.getMonth(),d.getDate(),d.getHours(),d.getMinutes()+exp,d.getSeconds(),d.getMilliseconds());

 }

 

 if(d)

 {

  nv+="expires="+d.toGMTString()+";";

 }

 

 if(!

path)

 {

  nv+="path=/;";

 }

 elseif(typeof(path)=="string"&&path!

="")

 {

  nv+="path="+path+";";

 }

 if(!

domain&&typeof(VS_COOKIEDM)!

="undefined")

 {

  domain=VS_COOKIEDM;

 }

 

 if(typeof(domain)=="string"&&domain!

="")

 {

  nv+="domain="+domain+";";

 }

 document.cookie=nv;

}

functionkf_getCookie(name)

{

 varvalue="";

 varcookies=document.cookie.split(";");

 varnv;

 vari;

 for(i=0;i

 {

  nv=cookies[i].split("=");

  if(nv&&nv.length>=2&&name==kf_rTrim(kf_lTrim(nv[0])))

  {

   value=unescape(nv[1]);

  }

 }

 returnvalue;

}

functionkf_sleepShow()   

{   

 kf_setCookie('hasshown',1,'','/',''); 

 

 varposition=parseInt(document.getElementById("rightDiv").style.top)+170;

 popupDivHtml='

10000;filter:

alpha(opacity=90);position:

absolute;top:

'+position+'px;right:

500px;color:

#000;font-size:

12px;cursor:

move;height:

150px;width:

340px;">';

 popupDivHtml+=kf_getPopupDivHtml(kfguin,ws,companyname,welcomeword);

 popupDivHtml+='';

 document.body.insertAdjacentHTML("beforeEnd",popupDivHtml);

}

functionkf_dealErrors() 

{

 kf_hide();

 returntrue;

}

functionkf_lTrim(str)

{

 while(str.charAt(0)=="")

 {

   str=str.slice

(1);

 }

 returnstr;

}

functionkf_rTrim(str)

{

 variLength=str.length;

 while(str.charAt(iLength-1)=="")

 {

   str=str.slice(0,iLength-1);

 iLength--;

 }

 returnstr;

}

window.onerror=kf_dealErrors;

varMyMove=newTong_MoveDiv();  

functionTong_MoveDiv()

   this.Move=function(Id,Evt,T) 

   {    

    if(Id=="") 

  {

举报
举报
版权申诉
版权申诉
word格式文档无特别注明外均可编辑修改;预览文档经过压缩,下载后原文更清晰! 立即下载
配套讲稿:

如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。

特殊限制:

部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。

关 键  词:
自动 弹出 对话框 QQ 在线 客服 系统 代码
提示  冰豆网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
关于本文
本文标题:自动弹出对话框的QQ在线客服系统代码.docx
链接地址:https://www.bdocx.com/doc/6450062.html
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2008-2022 冰点文档网站版权所有

经营许可证编号:鄂ICP备2022015515号-1

收起
展开