can use JS to determine the customer service QQ number online or offline status of the program

Source: Internet
Author: User

<pre name= "code" class= "HTML" > do not know from when the original QQ official brought online offline status code has not been able to accurately display online or offline status, and now use JS to judge QQ online offline status value, Output an online picture or an offline image based on the status value.
<script src= "Http://www.xjzypm.com/JS/jquery-1.5.1.min.js" ></script>
<div class= "Kfli" onclick= "openqq (' 111111 ')" > Customer service One </div ><div class= "Kfli" onclick= "openqq (' 222222 ')" > Customer service two </ Div><div class= "Kfli" onclick= "openqq (' 333333 ')" > Customer service Three </div>

<script>    var online = new Array (); </script><script type= "text/javascript" src= "http:// Webpresence.qq.com/getonline? type=1&111111:222222:333333: "></script><script type=" Text/javascript "> for    (var i = 0; i < Online.length; i++) {        if (online[i] = = 0) {            $ (". Kfli img"). EQ (i). attr ("src", "/onlinekf/offline.gif");        } else {            $ (". Kfli img "). EQ (i). attr (" src ", '/onlinekf/online.gif ');        }    } </script>

This is the main judge whether the customer service online program, and then add the desired effect. Here's my little code:


<script src= "Http://www.xjzypm.com/JS/jquery-1.5.1.min.js" ></script><style> #divMenu {position: Fixed;top:220px;right:0px;_position:absolute; _top:cursor:pointer; Display:none} #rightad {position:fixed;top:190px;right:7px;width:95px;height:180px;_position:absolute; font-size : 12px;} #scrollto {position:fixed;bottom:100px; Width:30px;right:0px;background: #368bcc; color: #FFF; cursor:pointer;  Text-align:center;_position:absolute; Display:none}.kfli {height:30px; line-height:30px; color: #FFF; text-align:center;cursor:pointer; border-bottom:1px Solid #fff} #leftad span, #rightad span{cursor:pointer;} </style><div id= "Divmenu" ></div > <div id= "Rightad" ><span style= "color: #0f8ed2" > Close </span><div style= "HEIGHT:351PX; Background:url (/onlinekf/onkf.jpg) #368bcc; Background-position:center top; background-repeat:no-repeat;width:91px "><div style=" height:90px; width:91px "><diV style= "WIDTH:91PX; height:91px; Cursor:pointer "></div><div class=" Kfli "onclick=" openqq (' 111111 ') "> Customer service One </div><div class=" Kfli "onclick=" openqq (' 222222 ') "> Customer service two </div><div class=" Kfli "onclick=" openqq (' 333333 ') "> Customer service three </div><div class= "Kfli" onclick= "openqq (' 444444 ')" > Market one </div><div class= "Kfli" onclick= "openqq (' 555555 ')" >< IMG src= "/onlinekf/online.gif" border= "0"/> Market two </div><div class= "Kfli" onclick= "openqq (' 666666 ')" >  Market three </div><div class= "Kfli" onclick= "OpenQQ (' 777777 ')" > Market four </div><div class= "Kfli" onclick= "OpenQQ (' 888888 ') ) "> Market five </div></div></div></div><script> var online = new Array (); </script><script type= "Text/javascript" src= "Http://webpresence.qq.com/getonline?" type=1&1844565410:363576965:2193744200:1315797152:1609979008:2690151979:3130711794:2825956442: "></  Script><script type= "Text/javascript" > for (var i = 0; i < online.length; i++) {if (online[i] = = 0)        {$ (". Kfli img"). EQ (i). attr ("src", "/onlinekf/offline.gif");        } else {$ (". Kfli img"). EQ (i). attr ("src", '/onlinekf/online.gif '); }}//close floating $ (document). Ready (function () {$ ("#rightad span"). Click (function () {$            ("#rightad"). Hide (300);        $ ("#divMenu"). Show (300);        });            $ ("#divMenu"). Click (function () {$ ("#rightad"). Slidedown (300);        $ ("#divMenu"). Hide (200);        });        /* $ ("#rightad"). MouseLeave (function () {$ ("#rightad"). Hide (200); $ ("#divMenu"). Show (300);        });    */    });            Window.onscroll = function () {if (Document.documentElement.scrollTop + document.body.scrollTop > 100) {        document.getElementById ("Scrollto"). Style.display = "block";        } else {document.getElementById ("Scrollto"). Style.display = "None";     }} function Opensmallwindows (strURL, scrollbar, width, height, left, top) {window.open (strURL, "_blank", "status=no,resizable=0,toolbar=no,menubar=no,scrollbars=" + ScrollBar + ", width=" + width + ", height=" + height + ", left    = "+ Left +", top= "+ Top +" "); } function Openqq (QQ) {window.location.href = "tencent://message/?uin=" + QQ + "&site=gbgjs.com&menu=ye    S "; }</script>


can use JS to determine the customer service QQ number online or offline status of the program

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.