以下是我网站的聊天脚本。它始终在我的网页右下角打开。我想在新的单独窗口中打开它。
function chat()
{
window.$zopim||(function(d,s){
var z = $zopim = function(c){
z._.push(c)
},
$ = z.s = d.createElement(s),
e = d.getElementsByTagName(s)[0];
z.set = function(o){
z.set._.push(o)
};
z._ = [];
z.set._ = [];
$.async = !0;
$.setAttribute('charset','utf-8');
$.src = '//v2.zopim.com/?1hwyxUI0W0lLoOIZZgBuVTfGzXIzNhGe';
z.t =+ new Date;
$.type = 'text/javascript';
e.parentNode.insertBefore($,e)
})(document,'script');
}
我是脚本新手,任何人都可以帮助我吗?
答案 0 :(得分:3)
最后我发现了几乎完美的一个。
<a href="#" onclick="openWin()" >Live Chat Online</a>
<script>
function openWin()
{
var myWindow = window.open("https://v2.zopim.com/widget/popout.html?key=1hwyxUI0W0lLoOIZZgBuVTfGzXIzNhGe","","width=500,height=500");
}
</script>
替换你的 key = 1hwyxUI0W0lLoOIZZgBuVTfGzXIzNhGe ,你可以从zopim生成的代码中获取它
$.src = '//v2.zopim.com/?1hwyxUI0W0lLoOIZZgBuVTfGzXIzNhGe';
答案 1 :(得分:2)
试试这个
<a href="javascript:void($zopim.livechat.window.openPopout())">Open chat in new window</a>