怎么能让别的网站页面弹出客服插件页面联系客服?

提问者:万博科技 问题分类:插件

客服系统安装在一个网站的后台,再在会员中心侧边按钮输入:javascript:$('[plugin-chat-event=toggleChatBox]').click()保存,本网站可以在侧浮条点击弹出小窗口聊天界面。

但另外一个新的网站,怎么安装插入客服代码呢?

回答数量1
浏览量270
1 个回答
满意答案
花晨月夕
花晨月夕 管理员
人生的每个抉择都像是一个赌局,输赢都是自己的。不管你压的赌注大与小,选择了就没有反悔的机会。输不起的人,往往也赢不了。

把下面的代码放到你要添加客服的网页中,在需要点击弹出客服的按钮上加属性onclick="openchat()"

<button onclick="openchat()">联系客服</button>
<style>
    #chatbox{
        display: none;
        position: fixed;
        width:500px;
        height: 500px;
        bottom:50px;
        right:50px;
        box-shadow: 0 0 5px 0 rgb(0,0,0,40%);
    }
    #chatbox iframe{
        width: 100%;
        height: 100%;
    }
    #chatbox .close{
        position: absolute;
        right: 0;
        top: -30px;
        font-size: 14px;
        background-color: red;
        color:#fff;
        padding:2px 4px;
        cursor: pointer;
    }
</style>
<script>
    function openchat(){
        chatbox.style.display='block';
        if (chatlink.src == location.href){
            chatlink.src='https://www.baidu.com/'//替换为客服页面链接
        }
    }
    function hidechat(){
        chatbox.style.display='none'
    }
</script>
<div id="chatbox">
    <div class="close" onclick="hidechat()">关闭</div>
    <iframe src="" frameborder="0" id="chatlink"></iframe>
</div>

发布于:4个月前 (06-06) IP属地:江苏省
万博科技
万博科技提问者

另外一个页面按你的代码加上了,点客服聊天没有弹出聊天窗口

发布于:4个月前 (06-10) IP属地:江西省
万博科技
万博科技提问者

另外一个页面按你的代码加上了,点客服聊天没有弹出聊天窗口

好的,搞定,谢谢可风。

发布于:4个月前 (06-11) IP属地:江西省

中秋促销

喜迎中秋节,共圆合家梦。
五折大促销,快来选购吧!
欢迎QQ/微信咨询我