/* 此插件基于Jquery 插g名:jquery.Sonline(在线客服插g) */ var ey_jquery_1619660740 = false; if (!window.jQuery) { ey_jquery_1619660740 = true; } if (ey_jquery_1619660740) { document.write(unescape("%3Cscript src='"+contact_root_dir_laoguaiwu+"/public/static/common/js/jquery.min.js' type='text/javascript'%3E%3C/script%3E")); document.write(unescape("%3Cscript type='text/javascript'%3E try{jQuery.noConflict();}catch(e){} %3C/script%3E")); } jQuery(function(){ jQuery.fn.Sonline = function(options){ var opts = jQuery.extend({}, jQuery.fn.Sonline.defualts, options); jQuery.fn.setList(opts); //调用列表讄 jQuery.fn.Sonline.styleType(opts); if(opts.DefaultsOpen == false){ jQuery.fn.Sonline.closes(opts.Position,0); } //展开 jQuery("#SonlineBox_laoguaiwu > .openTrigger").on("click",function(){jQuery.fn.Sonline.opens(opts);}); //关闭 jQuery("#SonlineBox_laoguaiwu > .contentBox > .closeTrigger").on("click",function(){jQuery.fn.Sonline.closes(opts.Position,"fast");}); //Ie6兼容或滚动方式显C? if (jQuery.browser && jQuery.browser.msie && (jQuery.browser.version == "6.0") && !jQuery.support.style||opts.Effect==true) {jQuery.fn.Sonline.scrollType();} else if(opts.Effect==false){jQuery("#SonlineBox_laoguaiwu").css({position:"fixed"});} } //plugin defaults jQuery.fn.Sonline.defualts ={ Position:"left",//left或right Top:200,//剙距离Q默?00px Effect:true, //滚动或者固定两U方式,布尔|true? Width:170,//剙距离Q默?00px DefaultsOpen:true, //默认展开Qtrue,默认收羃Qfalse Style:1,//图标的显C风|默认昄:1 Tel:"",//服务热线 Qqlist:"" //多个QQ?,'隔开QQQ和客服名?|'隔开 } //展开 jQuery.fn.Sonline.opens = function(opts){ var positionType = opts.Position; jQuery("#SonlineBox_laoguaiwu").css({width:opts.Width+4}); if(positionType=="left"){jQuery("#SonlineBox_laoguaiwu > .contentBox").animate({left: 0},"fast");} else if(positionType=="right"){jQuery("#SonlineBox_laoguaiwu > .contentBox").animate({right: 0},"fast");} jQuery("#SonlineBox_laoguaiwu > .openTrigger").hide(); } //关闭 jQuery.fn.Sonline.closes = function(positionType,speed){ jQuery("#SonlineBox_laoguaiwu > .openTrigger").show(); var widthValue =jQuery("#SonlineBox_laoguaiwu > .openTrigger").width(); var allWidth =(-(jQuery("#SonlineBox_laoguaiwu > .contentBox").width())-6); if(positionType=="left"){jQuery("#SonlineBox_laoguaiwu > .contentBox").animate({left: allWidth},speed);} else if(positionType=="right"){jQuery("#SonlineBox_laoguaiwu > .contentBox").animate({right: allWidth},speed);} jQuery("#SonlineBox_laoguaiwu").animate({width:widthValue},speed); } //风格选择 jQuery.fn.Sonline.styleType = function(opts){ var typeNum = 1; switch(opts.Style)   { case 1: typeNum = 41;    break case 2: typeNum = 42;    break case 3: typeNum = 44;    break case 4: typeNum = 45;    break case 5: typeNum = 46;    break case 6: typeNum = 47;    break    default: typeNum = 41;    } return typeNum; } //子插Ӟ讄列表参数 jQuery.fn.setList = function(opts){ jQuery("body").append("
客服中心
服务热线Q?/font>"+opts.Tel+"
"); if(opts.Tel==""){jQuery(".tels").remove();} jQuery("#SonlineBox_laoguaiwu > .contentBox").width(opts.Width) if(opts.Qqlist==""){jQuery("#SonlineBox_laoguaiwu > .contentBox > .listBox").append("

暂无在线客服?/p>")} else{var qqListHtml = jQuery.fn.Sonline.splitStr(opts);jQuery("#SonlineBox_laoguaiwu > .contentBox > .listBox").append(qqListHtml); } if(opts.Position=="left"){jQuery("#SonlineBox_laoguaiwu").css({left:0});} else if(opts.Position=="right"){jQuery("#SonlineBox_laoguaiwu").css({right:0})} jQuery("#SonlineBox_laoguaiwu").css({top:opts.Top,width:opts.Width+4}); var allHeights=0; if(jQuery("#SonlineBox_laoguaiwu > .contentBox").height() < jQuery("#SonlineBox_laoguaiwu > .openTrigger").height()){ allHeights = jQuery("#SonlineBox_laoguaiwu > .openTrigger").height()+4; } else{allHeights = jQuery("#SonlineBox_laoguaiwu > .contentBox").height()+40;} jQuery("#SonlineBox_laoguaiwu").height(allHeights); if(opts.Position=="left"){jQuery("#SonlineBox_laoguaiwu > .openTrigger").css({left:0});} else if(opts.Position=="right"){jQuery("#SonlineBox_laoguaiwu > .openTrigger").css({right:0});} } //滑动式效? jQuery.fn.Sonline.scrollType = function(){ jQuery("#SonlineBox_laoguaiwu").css({position:"absolute"}); var topNum = parseInt(jQuery("#SonlineBox_laoguaiwu").css("top")+""); jQuery(window).scroll(function(){ var scrollTopNum = jQuery(window).scrollTop();//获取|页被卷ȝ? jQuery("#SonlineBox_laoguaiwu").stop(true,false).delay(200).animate({top:scrollTopNum+topNum},"slow"); }); } //分割QQ jQuery.fn.Sonline.splitStr = function(opts){ var strs= new Array(); //定义一数组 var QqlistText = opts.Qqlist; strs=QqlistText.split(","); //字符分割 var QqHtml="" for (var i=0;i"+subStrs[1]+"Q?/span>

点击q里
" } return QqHtml; } }) ŷպ