Original Pure JS Customer service plugin set QQ, do-it, Skype, Baidu Hi, MSN
Customer service plug-in, set QQ, will, Skype, Baidu Hi, MSN and other instant communication tools, and can add their own supporting communication tools, minimalist, use their own pondering. My blog http://www.qiling.org
<script>//Online customer service plugin powered by Casejs minimalist http://www.mlrzw.cn functionCaseservice (caseserviceconfig) { This. config =Caseserviceconfig; This. ElementID = This. Config.elementid; This. TPL = { ' QQ ' : { ' href ': ' http://wpa.qq.com/msgrd?v=3&uin={#account #}&site=qq&menu=yes ', ' img ': ' http://wpa.qq.com/pa?p=2:{#account #}:{#style #}&time={#rand #} ' },' Wangwang ' : { ' href ': ' http://www.taobao.com/webww/ww.php?ver=3&touid={#account #}&siteid=cntaobao&status={#style # }&charset=utf-8 ', ' img ': ' http://amos.alicdn.com/online.aw?v=2&uid={#account #}&site=cntaobao&s=1&charset=utf-8 ' },' Skype ' : { ' href ': ' skype:{#account #}?call ', ' img ': ' http://mystatus.skype.com/smallclassic/{#account #} ' },' Baiduhi ' : { ' href ': ' baidu://message/?id={#account #} ', ' img ': ' Http://tieba.baidu.com/tb/img/hi/hiOnline.gif ' },' MSN ' : { ' href ': ' msnim:chat?contact={#account #} ', ' img ': ' Http://tieba.baidu.com/tb/img/hi/hiOnline.gif ' } }; //Create HTML This. buildhtml (); //setting off varthat = This; document.getElementById ( This. ElementID + ' _sbtnclose '). onclick =function() {that.hide (); }; //Settings Opendocument.getElementById ( This. ElementID + ' _sbtnopenarea '). onclick =function() {that.show (); }; //assigning an HTML object to an element This. Element = document.getElementById ( This. Config.elementid); //determine if the display This. Config.isopen? This. Show (): This. Hide (); //the last position to scroll to This. lastscrolly = 0; //scrolling This. Slide ();} //Show Floating WindowCaseService.prototype.show =function() {document.getElementById ( This. ElementID + "_sbtnopenarea"). Style.display = ' None '; document.getElementById ( This. ElementID + "_servicewin"). Style.display = ' block '; }; //Hide Floating windowCaseService.prototype.hide =function() {document.getElementById ( This. ElementID + "_servicewin"). Style.display = ' None '; document.getElementById ( This. ElementID + "_sbtnopenarea"). Style.display = ' block '; //If you set the hide, close the Cancel event and empty the DOM if( This. Config.closeashide = =false){ if( This. Interval) {Window.clearinterval ( This. Interval); } //Empty Dom This. element.innerhtml = "; } }; //Scrolling Floating windowCaseService.prototype.slide =function() { //set timed events automatically if(! This. Interval) { varthat = This; This. Interval = Window.setinterval (function() {that.slide (); },1); } //get the distance from the top if(Document.documentelement &&Document.documentElement.scrollTop) { varDiffy =Document.documentElement.scrollTop; }Else{ varDiffy =Document.body.scrollTop}varPercent =. 1 * (Diffy- This. lastscrolly); Percent= (Percent > 0)?Math.ceil (percent): Math.floor (percent); This. Element.style.top = parseint ( This. element.style.top) + percent + "px"; This. lastscrolly + =percent; }; CaseService.prototype.buildHtml=function(){ //Set shutdown Events varAccountlist = ' '; for(i = 0;i < This. config.accountArray.length; i++) {accountlist+= (function(){/*<div class= "Sitem" > <label>{#label #}</label> <a target= "_blank" href= "{#href #}" title= "{#tip #}" > </ A> </div>*/}.tostring (). replace (/^.+?\*|\\ (? =\/) |\*.+?$/gi, "")) //Replace link and status picture must be in front. replace (/{#href #}/g, This. tpl[ This. Config.accountarray[i].type].href). Replace (/{#img #}/g, This. tpl[ This. config.accountarray[i].type].img)//Replace other parameters. replace (/{#label #}/g, This. Config.accountarray[i].label). Replace (/{#account #}/g, This. Config.accountarray[i].account). Replace (/{#style #}/g, This. Config.accountarray[i].style). Replace (/{#tip #}/g, This. Config.accountarray[i].tip). Replace (/{#rand #}/g, This. Config.accountarray[i].rand); }; varCSS = (function(){/* <style type= "Text/css" >. caseservice {font-family: ' Microsoft Jacob Black '; text-align:left;} . caseservice. servicewin {width:168px;height:auto;border:2px solid {#cssColor #};z-index:999999;} . caseservice. stitle {background:{#cssColor #};p adding:8px 10px;font-size:14px;color: #FFF;p osition:relative}. Case Service. sbtnclose {width:25px;height:25px;cursor:pointer;position:absolute;top:3px;right:10px;font-size:25px; Line-height:25px;text-align:right;} . caseservice. sList {font-size:14px;color: #444; font-size:13px;line-height:20px;padding:10px;background: #FFF} . Caseservice. SList. sitem{height:30px}. Caseservice. sList Label{display:block;width:47%;text-align:right;over Flow:hidden;white-space:nowrap;height:30px;float:left}. Caseservice. sList A{display:block;width:52%;float:left;o verflow:hidden;height:30px;border:0;padding:0;margin:0}. Caseservice. sList Img{display:inline-block;border:0;pad Ding:0;margin:0}. Caseservice. other{border-top:1px dotted #ccc; Margin-top:10px;font-size:17px;text-align:center;line-heig HT:28PX;PADDING-TOP:5PX}. Caseservice. sbtnopenarea {background:{#cssColor #};height:auto;padding:15px 0;width: 31px;display:none;color: #FFF; Font-size:15px;text-align:center;line-height:20px;cursor:pointer}. CaseService. sBt nopen{font-size:24px;height:25px;} </style>*/}.tostring (). replace (/^.+?\*|\\ (? =\/) |\*.+?$/gi, "")). Replace (/{#cssColor #}/g, This. Config.color); varTPL = (function(){/*<div id= "{#elementId #}" class= "Caseservice" style= "{#style #}" > <div id= "{#elementId #}_ Sbtnopenarea "class=" Sbtnopenarea "> <div class=" Sbtnopen ">+</div> {#closeTitle #} </div> <div id= "{#elementId #}_servicewin" class= "Servicewin" style= "{#width #}" > <div class= "Stitle" >{#openTitle #} <div id= "{#elementId #}_sbtnclose" class= "Sbtnclose" > x</div> </div> <div class= "SList" > {#accoundList #} <div class= "Other" > {#other #} </div> </div> </div> </div>*/}.tostring (). replace (/^.+?\*|\\ (? =\/) |\*.+?$/gi, "")); //Stitching HTMLSERVICEWINTPL = CSS +TPL. Replace (/{#elementId #}/g, This. Config.elementid). Replace (' {#other #} ', This. Config.other). Replace (' {#accoundList #} ', accountlist). Replace (' {#width #} ', This. Config.width). Replace (' {#style #} ', This. Config.style). Replace (' {#closeTitle #} ', This. Config.closetitle). Replace (' {#openTitle #} ', This. Config.opentitle); document.write (SERVICEWINTPL); }; //Online customer service plugin powered by Casejs NewCaseservice ({"ElementID": "Myservicewin", "Color": "#266ed2", "Opentitle": "Customer Service Center", "Closetitle": "Lian <br/> department <br/> me <br/> Guys", "Style": "right:0px; Top:180px;position:absolute; ", "width": "width:170px;", "IsOpen": "True", "Closeashide": "True", "Other": "Service hotline <BR/>0546-8238915", "Accountarray": [ { "Type": "QQ", "Label": "Online customer Service:", "Account": "2095128673", "Tip": "Customer service is currently online, Welcome to contact me", "Style": "1" }, { "Type": "QQ", "Label": "Online customer Service:", "Account": "1113635625", "Tip": "Customer Service Online", "Style": "1" }, { "Type": "QQ", "Label": "Technical QQ:", "Account": "781787584", "Tip": "Click and Contact Me", "Style": "7" }, { "Type": "Wangwang", "Label": "Technology Wang Wang:", "Account": "Colorful 70", "Tip": "Click to contact Me", "Style": "1" }, { "Type": "MSN", "Label": "Technical msn:", "Account": "Wang Leizhi", "Tip": "Click and Contact Me", "Style": "0" }, { ' type ': ' Skype ', "Label": "Skype:", "Account": "15154625521", "Tip": "I'm online please contact me", "Style": "0" } ] } ); </script>
Pure JS Customer Service plug-in set QQ, do-it, Skype, Baidu Hi, MSN