In the recommendation of "QQ online customer service code can be dragged floating" and then recommended "QQ online consulting code up and down floating type", a friend asked me whether there is a simple floating online QQ consulting service code, in fact, I sold a xiaoguanzi said principle. Forget it or upload an online QQ consulting service Code demo image bar. Such as:
Looks very ugly, but this is very concise floating QQ customer service code, in fact, the most simple QQ online customer service code is still http://imis.qq.com/webpresence/code.shtml official, but can not float. Wait for a package download of the source program.
First look at the floating part of the code, this floaters function is to let a DIV element floating
function floaters () {http://www.hebby120.com
This.items = [];
This.additem = function (id,x,y,content) {
document.write ('
' +content+ ');
var newitem = {};
Newitem.object = document.getElementById (ID);
newitem.x = x;
Newitem.y = y;
This.items[this.items.length] = NewItem;
}
This.play = function () {
Collection = This.items
SetInterval (' Play () ', 10);
}
}
Then is the display part of the code, play this function is to control the online QQ consulting customer Service Code display:
function Play () {
if (screen.width<=800) {
for (Var i=0;i
Collection[i].object.style.display = ' None ';
}
Return
}
for (Var i=0;i
var followobj = Collection[i].object;
var followobj_x = (typeof (collection[i].x) = = ' string '? Eval (collection[i].x): collection[i].x);
var followobj_y = (typeof (collection[i].y) = = ' string '? Eval (collection[i].y): COLLECTION[I].Y);
if (followobj.offsetleft!= (document.body.scrollleft+followobj_x)) {
var dx= (document.body.scrollleft+followobj_x-followobj.offsetleft) *delta;
dx= (dx>0?1:-1) *math.ceil (math.abs (DX));
FOLLOWOBJ.STYLE.LEFT=FOLLOWOBJ.OFFSETLEFT+DX;
}
if (followobj.offsettop!= (document.body.scrolltop+followobj_y)) {
var dy= (document.body.scrolltop+followobj_y-followobj.offsettop) *delta;
Dy= (dy>0?1:-1) *math.ceil (Math.Abs (dy));
Followobj.style.top=followobj.offsettop+dy;http://www.hebckyy.com
}
FollowObj.style.display = ";
}
}
Floating online QQ Consulting service Code