【发布时间】:2022-02-14 23:58:36
【问题描述】:
我正在尝试向我的聊天机器人添加一个按钮,以便可以打开(启动)和关闭它,但我正在努力将其添加到聊天机器人区域,我也不确定它是否能正常工作'测试它。抱歉,如果这很容易解决,但我在这里有点新手。
我的小部件代码如下:
<div
class="chat-popup"
id="webchat"
role="main"
style="height: 30%; width: 15%; margin-top: 5%; margin-left: 10%"
>
<span class="close_div" onclick="close_div(1)">✖</span>
</div>
<script
src="https://omnireach.net/webchat?key=PbjMaijC3EKXWii/ANCiHQ=="
type="text/javascript"
></script>
<script>
window.onload = function () {
var styleOptions = {
hideUploadButton: false,
bubbleFromUserBackground: "lightblue",
sendBoxButtonColor: "red",
typingAnimationDuration: 5000,
typingAnimationHeight: 20,
typingAnimationWidth: 64,
timestampColor: undefined,
timestampFormat: "relative",
botAvatarImage:
"https://zincgroupdevelopment.com/wp-content/uploads/2021/06/Talk-to-us-1.png",
};
orWebChat.start(styleOptions, "webchat");
};
function close_div(id) {
if (id === 1) {
jQuery("#webchat").hide();
}
}
</script>
【问题讨论】:
标签: javascript html chatbot