Using JavaScript to realize QQ customer service code

Source: Internet
Author: User

Often in some sites to see QQ customer service effect, when the customer service staff online, the QQ on the Web page displayed as online status, not the line, the page on the QQ display offline status, this is achieved through JavaScript.
<script language=javascript>
function Picsize (obj,maxwidth) {
Img=new image ()//Create a new Image object, with the width of this object will not appear a width of 0 phenomenon
Img.src= "/FK/BLOG/OBJ.SRC";
if (img.width>maxwidth)
{
return maxwidth;
}
Else
{
return img.width;
}
}
</script>
<style>
<!--
div {font-size:12px;}
-->
</style>
<body>
<SCRIPT>
var online= new Array ();
if (!document.layers)
document.write (' <div id= "Divstaytopleft" style= "Position:absolute" > ")
</SCRIPT>
<layer id= "Divstaytopleft" >
<table border= "0" width= "cellspacing=" 0 "cellpadding=" 0 ">
&LT;TR&GT;&LT;TD width= "></td></tr>
<script src= "http://webpresence.qq.com/getonline?Type=1&391193603:471133041:" ></script>

<!--set two QQ numbers, corresponding to the following two-->
<TR><TD valign=middle background= "Images/mid5.gif" >
<script>
if (online[0]==0)
document.write ("<div align=center><a class=" QQB '

Target=blank href= ' http://wpa.qq.com/msgrd? V=1&uin=391193603&site= Online Consulting & Menu=no ' title= ' customer service is not on line, please leave a message ' > Technician </a></div> ');
Else
document.write ("<div align=center><a class= ' Qqa ')

Target=blank href= ' http://wpa.qq.com/msgrd?V=1&Uin=391193603&Site= online consultation &menu= no ' t

itle= ' online instant conversation ' > Technician </a></div> ');
</script>
</td></tr>
<TR><TD valign=middle background= "Images/mid5.gif" >
<script>
if (online[1]==0)
document.write ("<div align=center><a class=" QQB '

Target=blank href= ' http://wpa.qq.com/msgrd?V=1&Uin=471133041&Site= online consultation & Menu=no ' title= ' customer service is not on line,

Please leave a message ' > guest &nbsp;&nbsp; service </a></div> '];
Else
document.write ("<div align=center>

<a class= ' Qqa ' Target=blank

Href= ' http://wpa.qq.com/msgrd?V=1&Uin=471133041&Site= online &menu= no ' title= ' online instant chat ' >

Customer &nbsp;&nbsp; Service </a></div> ");
</script>
</td></tr>
&LT;TR&GT;&LT;TD width= "></td></tr>
</table>
<script type= "Text/javascript" >
Enter "Frombottom" or "Fromtop"
var verticalpos= "Frombottom"
if (!document.layers)
document.write (' </div> ')
function Jsfx_floattopdiv ()
More javascript:http://
{
var startx = 6,
Starty = 150;
var ns = (navigator.appName.indexOf ("Netscape")!=-1);
var d = document;
function ml (ID)
{
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;
if (verticalpos== "Fromtop")
El.y = Starty;
else{
EL.Y = ns? pageYOffset + InnerHeight:document.body.scrollTop + document.body.clientHeight;
EL.Y-= Starty;
}
Return el;
}
Window.staytopleft=function ()
{
if (verticalpos== "Fromtop") {
var PY = ns? PageYOffset:document.body.scrollTop;
Ftlobj.y + = (PY + starty-ftlobj.y)/8;
}
else{
var PY = ns? pageYOffset + InnerHeight:document.body.scrollTop + document.body.clientHeight;
Ftlobj.y + + = (PY-STARTY-FTLOBJ.Y)/8;
}
FTLOBJ.SP (ftlobj.x, FTLOBJ.Y);
SetTimeout ("Staytopleft ()", 10);
}
Ftlobj = ml ("Divstaytopleft");
Staytopleft ();
}
Jsfx_floattopdiv ();
</script>
<br>
<br>
<br>
<br>
</body>

-->

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.