Hide live chat link when offline
I would like to install LiveHelpNow as a link which will hide when all operators are offline.
Here are steps by step instructions:
- This step is only required if LiveHelpNow chat or helpOut button code is not already installed on your web page: Install invisible button code anywhere on your web page. Invisible button code may be found in Admin Panel->Chat system->installation->Live chat button->For websites.
- Add the HTML code to your web page for the link similar to this: <a id="lhnLiveChatLink" href="#" onclick="OpenLHNChat();return false;">Live chat</a>
- Add this JavaScript code to the page:
<script type="text/javascript">
function LHN_button_onLoad() {
if (bLHNOnline == 0) {
//All operators are offline
document.getElementById('lhnLiveChatLink').style.display='none';
}
else {
//There are operators online
document.getElementById('lhnLiveChatLink').style.display='block';
}
}
</script> - Done