我想在我的网站上单击一个按钮以启动Manychat机器人
这是按钮的HTML,它以前是电子邮件订阅
<div class="join_the_club_form_con">
<div class="join_the_club_btn open_cl_btn_top">JOIN THE CLUB</div>
<div class="join_the_club_pop open_cl_btn_top_con">
<i class="fa fa-remove remove_pop_btn"></i>
<h3 class="pop_head_line">Become a VIP Member for Free</h3>
<p>Get Creative for Less. Join the Original Stationery VIP Club for free products, discounts, videos and more...</p>
</div>
我希望按钮在单击时打开Manychat按钮,我尝试通过Manychat添加代码,但没有用
这是Manychat代码
<!-- ManyChat -->
<script src="//widget.manychat.com/180024982377977.js" async="async">
</script>
<div class="mcwidget-embed" data-widget-id="3462936"></div>
很简单,我想使按钮打开ManyChat bot
答案 0 :(得分:1)
您只需在您的其他脚本(通常在HTML的标题或底部)中的HTML中从Manychat中添加<script>
。
然后您添加<div class="mcwidget-embed" data-widget-id="3462936"></div>
而不是<div class="join_the_club_btn open_cl_btn_top">JOIN THE CLUB</div>
,然后从按钮(join_the_club_btn open_cl_btn_top
中添加类。 OR 将其添加到其中(取决于您的CSS)。
希望这会有所帮助:)
答案 1 :(得分:1)
设置所有visibility: hidden
并订阅按钮必须看起来像:<button id=“btn” onclick=“opensub()”>Want to subscribe?</button>
,然后在按钮准备好后,我们需要使subscribe block或您想要的任何东西。 <div id=“sub”>Subscribe</div>
<script>function opensub(){document.GetElementById(“sub”).style.visibility=“visible”}</script>
将显示订阅窗口,然后再次单击后使其消失(请DIY)(执行相同操作,但重命名功能并将可见更改为隐藏)。
请检查代码是否正确(我是通过电话输入)