我有Zoplim插件(聊天功能)我希望隱藏這個,直到我的按鈕被點擊。隱藏聊天室腳本,直到按鈕單擊
所以聊天室被隱藏,直到聞測試按鈕被按下,則衣帽間顯示
腳本
<script type="text/javascript">
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/?1l9izSc2QRurE71l1L7ugke4Soo38dPc';
z.t = +new Date;
$.type = 'text/javascript';
e.parentNode.insertBefore($, e)
})(document, 'script');
</script>
我的按鈕HTML
<button id="finish-button" class="button finish m2">End test</button>
我已嘗試
<script type="text/javascript">
document.getElementById("finish-button").onclick = function()
{myFunction()};
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/?1l9izSc2QRurE71l1L7ugke4Soo38dPc';
z.t = +new Date;
$.type = 'text/javascript';
e.parentNode.insertBefore($, e)
})(document, 'script');
</script>
這裏是'myFunction的()'的代碼? – madalinivascu
https://jsfiddle.net/8j8novbp/4/ –
你會得到什麼樣的錯誤?你究竟在哪裏卡住? –