如何添加带有弹出窗口的滚动聊天按钮



我目前正在使用 https://getbutton.io/。但问题是他们的css和JavaScript非常慢。我想为Facebook和WhatsApp创建自己的滚动按钮。请帮我编码

https://static.getbutton.io/css/whatshelp-font.css

https://static.getbutton.io/widget-send-button/js/widget/desktop.js

https://static.getbutton.io/widget-send-button/css/style.css

https://static.getbutton.io/widget-send-button/js/init.js

<script type="text/javascript">
(function () {
var options = {
facebook: "1769615853297972", // Facebook page ID
whatsapp: "+9203038518000", // WhatsApp number
call_to_action: "Message us", // Call to action
button_color: "#FF6550", // Color of button
position: "right", // Position may be 'right' or 'left'
order: "facebook,whatsapp", // Order of buttons
};
var proto = document.location.protocol, host = "getbutton.io", url = proto + "//static." + host;
var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = url + '/widget-send-button/js/init.js';
s.onload = function () { WhWidgetSendButton.init(host, proto, options); };
var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x);
})();
</script>
<!-- /WhatsHelp.io widget -->
Please help me to make my own code so I did'nt need to use getbutton js and css files and I can host on my own server.

使用以下代码

<script type="text/javascript">
(function () {
var options = {
facebook: "1769615853297972", // Facebook page ID
whatsapp: "+9203038518000", // WhatsApp number
call_to_action: "Message us", // Call to action
button_color: "#FF6550", // Color of button
position: "right", // Position may be 'right' or 'left'
order: "facebook,whatsapp", // Order of buttons
};
var proto = document.location.protocol, host = "whatshelp.io", url = proto + "//static." + host;
var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = url + '/widget-send-button/js/init.js';
s.onload = function () { WhWidgetSendButton.init(host, proto, options); };
var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x);
})();
</script>

最新更新