Intelligent Triggers can not work
I've written the code for two banners as below, but it doesn't work.
If I only use the one of code, it works well. I don't know why.
<!-- new Banner start -->
<div class="float_layer_hovertree" id="hovertree_float_layer" style="z-index:10001;
display: none;
position: fixed;
top: 185px;
box-shadow:1px 1px 10px -1px #aaa;
border-radius: 5px;
z-index: 10001;
width: auto;
max-width: 90%;
background-color: white;">
<h2 style="height: 25px; line-height: 25px; padding-left: 10px; font-size: 14px; color: #eee; position: relative; margin-top:0px; margin-bottom: 0px; border-radius:5px 5px 0px 0px; text-align: left">
<b style="color: #666666">News</b>
<a id="closeadv" href="javascript:;" class="close" target="_self" style="color:#666666; position: absolute; right: 12px;">
<i class="fa fa-times"></i>
</a>
</h2>
<div class="content" style="margin:5px; overflow: hidden; font-size: 14px; line-height: 18px; color: #666;">
<div class="wrap">
<a href="
http://www.chainsea.com.tw" target="_blank">
<img src="
http://www.lannerinc.com/images/stories/20180129-1.jpg" width="100%" />
</a>
</div>
</div>
<script type="text/javascript">
var $zoho = $zoho || {}; $zoho.salesiq = $zoho.salesiq ||
{ widgetcode: "7b292228c34529bdf9f53ac343a7470ffeef696e39490c60fb8202c4ae3c1b7c42fa8781fa49e20ab9814f8d02c0b7ba", values: {}, ready: function () { } };
var d = document; s = d.createElement("script"); s.type = "text/javascript"; s.id = "zsiqscript"; s.defer = true;
s.src = "
https://salesiq.zoho.com/widget"; t = d.getElementsByTagName("script")[0]; t.parentNode.insertBefore(s, t); d.write("<div id='zsiqwidget'></div>");
</script>
<script>
$zoho.salesiq.ready = function (embedinfo) {
$zoho.salesiq.visitor.trigger(function (triggername, visitorinfo) {
if (triggername == 'Discount Banner') {
showDiscount();
}
});
};
// window.setTimeout(function(){showDiscount()},5000);
jQuery(function ($) {
$("#closeadv").click(function () {
$("#hovertree_float_layer").fadeOut("slow");
});
$(window).resize(function() {
console.log("hovertree_float_layer: " + $("#hovertree_float_layer").width() + " window: " + $(window).width());
var left = ($(window).width() - $("#hovertree_float_layer").width())/2 + "px";
$("#hovertree_float_layer").css("left",left);
});
});
function showDiscount() {
jQuery(function ($) {
$("#hovertree_float_layer").fadeIn("slow");
});
}
function setposotion() {
console.log("hovertree_float_layer: " + $("#hovertree_float_layer").width() + " window: " + $(window).width());
var left = ($(window).width() - $("#hovertree_float_layer").width())/2 + "px";
$("#hovertree_float_layer").css("left",left);
}
</script>
</div>
<!-- new Banner end -->
<!-- Banner start -->
<div class="float_layer_hovertree" id="hovertree_float_layer2" style="z-index:10001;
display: none;
position: fixed;
padding: 0;
margin: 0;
bottom: 105px;
right: 5px;
box-shadow:1px 1px 10px -1px #aaa;
border-radius: 5px;
z-index: 10001;
background-color: white;">
<h2 style="height: 25px; line-height: 25px; padding-left: 10px; font-size: 14px; color: #eee; position: relative; margin-top:0px; margin-bottom: 0px; border-radius:5px 5px 0px 0px; text-align: left">
<b style="color: #666666">News</b>
<a id="closeadv2" href="javascript:;" class="close" target="_self" style="color:#666666; position: absolute; right: 12px;">
<i class="fa fa-times"></i>
</a>
</h2>
<div class="content" style="margin:5px; overflow: hidden; font-size: 14px; line-height: 18px; color: #666;">
<div class="wrap">
<a href="
http://www.chainsea.com.tw" target="_blank">
<img src="
http://lannerinc.com/images/stories/20180129-5.jpg" width="100%" />
</a>
</div>
</div>
<script type="text/javascript">
var $zoho = $zoho || {}; $zoho.salesiq = $zoho.salesiq ||
{ widgetcode: "7b292228c34529bdf9f53ac343a7470ffeef696e39490c60fb8202c4ae3c1b7c42fa8781fa49e20ab9814f8d02c0b7ba", values: {}, ready: function () { } };
var d = document; s = d.createElement("script"); s.type = "text/javascript"; s.id = "zsiqscript"; s.defer = true;
s.src = "
https://salesiq.zoho.com/widget"; t = d.getElementsByTagName("script")[0]; t.parentNode.insertBefore(s, t); d.write("<div id='zsiqwidget'></div>");
</script>
<script>
$zoho.salesiq.ready = function (embedinfo) {
$zoho.salesiq.visitor.trigger(function (triggername, visitorinfo) {
if (triggername == 'Discount Banner2') {
showDiscount2();
}
});
};
//window.setTimeout(function(){showDiscount2()},5000);
jQuery(function ($) {
$("#closeadv2").click(function () {
$("#hovertree_float_layer2").fadeOut("slow");
});
if ($(window).width() <= 414)
$("#hovertree_float_layer2").css("width","125px");
else if ($(window).width() > 414 && $(window).width() <= 768)
$("#hovertree_float_layer2").css("width","200px");
else
$("#hovertree_float_layer2").css("width","auto");
$(window).resize(function() {
if ($(window).width() <= 414)
$("#hovertree_float_layer2").css("width","125px");
else if ($(window).width() > 414 && $(window).width() <= 768)
$("#hovertree_float_layer2").css("width","200px");
else
$("#hovertree_float_layer2").css("width","auto");
});
});
function showDiscount2() {
jQuery(function ($) {
$("#hovertree_float_layer2").fadeIn("slow");
});
};
</script>
</div>
<!-- Banner end -->
Sticky Posts
OpenAI Alert! Plug Sample #11 - Next-generation chatbots, Zobot + ChatGPT Assistant
Hi Everyone! We have great news for all AI enthusiasts and ChatGPT users! The much anticipated Zobot integration with ChatGPT Assistant is now available with Plugs. OpenAI has introduced 'ChatGPT Assistants' to customize GPT models as per your requirement.
Get live insights on business performance with the SalesIQ TV App - Now available for Apple and Android TVs!
Hello everyone! Let's start with a question - What do you think is the key to a thriving business? Yes, I hear you. It's all about the customers. Success in business often starts with understanding customer needs. But wouldn't you agree that achieving
Deprecation of Google Drive and Sheets connections in Scripts (Deluge)
Hello Everyone, We have an important update for those using the Script (Deluge) platform to build chatbots, widgets, and forms. Google has alerted us about sensitive scopes within the Google Drive and Google Sheets default connections in Deluge. As a
Plug Sample #10 - Simplify Ticket Management (Zoho Desk) with Chatbots
Hi everyone! We're here with another simple yet effective plug for your chatbot to integrate with Zoho Desk. When a customer reports an issue/request during chat, it's logged as a ticket on Desk. When they return for updates, you end up searching through
Plug Sample #5 - Read and write values/data in a Google sheet with Zobot
We all know google sheets are one of the widely used spreadsheet software. It helps us to make data-driven decisions. When connecting the Zobot with sheets, the bot can display values/data from a spreadsheet, like the available stock details (Item price,