Javascript API
New Widget
setLayout
Set the layout of the chat badge.
Parameters
| layout | Name of the layout (string). |
Allowed values
- image_right (Image on right, text on left)
- image_left (Image on left, text on right)
- image_only (Image only)
- text_only (Text only)
Example
Select chat badge layout:
<a href="javascript:void($zopim.livechat.badge.setLayout('image_right'))">Image right</a>
<a href="javascript:void($zopim.livechat.badge.setLayout('image_left'))">Image left</a>
<a href="javascript:void($zopim.livechat.badge.setLayout('image_only'))">Image only</a>
<a href="javascript:void($zopim.livechat.badge.setLayout('text_only'))">Text only</a>setColor
Set the color of the chat badge.
Note: theme.reload must be called after setColor for changes to take effect (see example below).
Parameters
| color | Badge color, in hexadecimal format (‘#AABBCC’) |
Examples
<script>
$zopim(function() {
$zopim.livechat.badge.setColor('#000000');
$zopim.livechat.theme.reload(); // apply new theme settings
});
</script>Set the text displayed on the chat badge.
function setText( text )
Show the chat badge.
function show()
Hide the chat badge.
function hide()

