//客服轮转js
$(function () {
$("div[data-marquee=marquee]").marquee(); //marquee
var b2 = "";
b2 += '
'+'';
b2 += ''+'';
b2 += ''+'';
b2 += ''+'';
b2 += ''+'';
b2 += ''+'';
b2 += ''+'';
b2 += ''+'';
b2 += ''+'';
b2 += ''+'';
b2 += ''+'';
b2 += ''+'';
b2 += ''+'';
$.ajax({
type: "post",
url: "/hrinfo/list",
data: {},
datatype: "json",
success: function (d) {
if (0 == d.code) {
var b = "";
$.each(d.list, function (d, f) {
b += ''+
''+
'';
});
$("#xs-list ul").html(b);
$(".txtscroll-left .bd ul").html(b2);
//销售列表
$("#xs-list").marquee();
//固定销售列表
$("#sales").jcarousellite({
auto: 10000,
speed: 1000,
scroll: 3,
visible: 3
}).show();
// $(document).scroll(function(){
// if($(this).scrolltop()>($("#a4").offset().top-200)){
// $(document).off();
// jquery(".txtscroll-left").slide({
// titcell: ".hd ul",
// maincell: ".bd ul",
// autopage: true,
// effect: "leftloop",
// autoplay: true,
// intertime: "10000",
// scroll: 4,
// vis: 4
// }).show();
// }
// });
} else {
alert(d.msg)
}
}
})
});
//marquee
$.fn.extend({
marquee: function (options) {
//处理参数
options = $.extend({
linenum: 1,
speed: 40,
delay: 1000
}, options);
return $(this).each(function () {
var o = this;
var t;
var p = false;
o.innerhtml += o.innerhtml;
o.onmouseover = function () { p = true }
o.onmouseout = function () { p = false }
o.scrolltop = 0;
var lheight = $(o).find("li").outerheight(true);
var len = $(o).find('li').length;
o.style.overflow = "hidden";
o.style.height = lheight * len / 2 + 'px';
//alert(lheight * len /2);
function start() {
t = setinterval(scrolling, options.speed);
if (!p) { o.scrolltop += 1; }
}
function scrolling() {
if (o.scrolltop % lheight != 0) {
o.scrolltop += 1;
if (o.scrolltop >= o.scrollheight / 2) o.scrolltop = 0;
} else {
clearinterval(t);
settimeout(start, options.delay);
}
}
settimeout(start, options.delay);
});
}
})
//qqww插件
$(function () {
$("a[qqcj=a]").a();
});
//marquee
$.fn.extend({
a: function () {
$(this).append('');
var a = $(this).attr("qq");
$(this).attr("href", 'http://wpa.qq.com/msgrd?v=3&uin=' + a + '&site=qq&menu=yes');
}
});
//ww
$(function () {
$("a[qqcj=a2]").a2();
});
$.fn.extend({
a2: function () {
$(this).append('');
var b = $(this).attr("ww");
$(this).attr("href", 'http://amos.im.alisoft.com/msg.aw?v=2&uid=' + b + '&site=cnalichn&s=4');
}
});