Skip to content

Instantly share code, notes, and snippets.

@amirkhan81
Created November 30, 2016 23:13
Show Gist options
  • Save amirkhan81/0e584eea4c816b027b67be2f91369e86 to your computer and use it in GitHub Desktop.
Save amirkhan81/0e584eea4c816b027b67be2f91369e86 to your computer and use it in GitHub Desktop.
<script src="/scripts/dev/min/jquery.cookie-min.js"></script>
<img id="liveChat" src="/media/6015/lc-button3.png"
style="cursor: pointer; cursor:hand; position: fixed; left: 0; top: 300px; display: none; height: 140px; z-index: 999;" class="nonResponsive mobiHide" onclick="Velaro.Engagement.LoadPopoutChat()">
<script type="text/javascript">
jQuery(document).ready(function(){
if (getCookie('chat_shown') != 'true')
{
var timeout_show_chat = setTimeout('showChat()', 30*1000);
}
else
{
showChat();
}
});
function showChat()
{
if (jQuery('.yoursubdomain_floatbtn').css('display') == 'none' && getCookie('chat_shown') != 'true')
{
setCookie('chat_shown', 'true', 60);
}
jQuery('style[data-type="csupport_preload"]').remove();
}
function setCookie(c_name,value,exdays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;
}
function getCookie(c_name)
{
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++)
{
x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
x=x.replace(/^\s+|\s+$/g,"");
if (x==c_name)
{
return unescape(y);
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment