Zopim is now called Zendesk Chat. All API functionality will continue to work as normal and the namespace will not change in the immediate future.

Javascript API

$zopim.livechat.bubble

Customize and control the chat bubble.

Note: The chat bubble is only available when using the classic theme.  These API functions have no effect if another theme is in use.

Note: Hiding the chat button will also hide the chat bubble.

Summary
$zopim.livechat.bubbleCustomize and control the chat bubble.
Functions
setColorSet the color of the chat bubble.
showShow the chat bubble.
hideHide the chat bubble.
resetShow the chat bubble.
setTitleSet the title displayed on the chat bubble.
setTextSet the text displayed on the chat bubble.

Functions

setColor

Set the color of the chat bubble.

Note: theme.reload must be called after setColor for changes to take effect (see example below).

Parameters

colorBubble color, in hexadecimal format (‘#AABBCC’)

Example

<script>

  $zopim(function() {
    $zopim.livechat.bubble.setColor('#000000');
    $zopim.livechat.theme.reload(); // apply new theme settings
  });

</script>

show

function show()

Show the chat bubble.

If the user manually hide the chat bubble, it will remain hidden on subsequent page loads until the current session expires, or the reset API function is called.

Note: This function also shows the chat button if it is not already visible.

Example

<script>

  $zopim(function() {
    $zopim.livechat.bubble.show();
  });

</script>

hide

function hide()

Hide the chat bubble.

Example

<script>

  $zopim(function() {
    $zopim.livechat.bubble.hide();
  });

</script>

reset

function reset()

Show the chat bubble.

The chat bubble will be shown on subsequent page loads until it is hidden by the user.

Example

<script>

  $zopim(function() {
    $zopim.livechat.bubble.reset();
  });

</script>

setTitle

function setTitle(title)

Set the title displayed on the chat bubble.

Parameters

titleChat bubble title (string)

Example

<script>

  $zopim(function() {
    $zopim.livechat.bubble.setTitle('Hi there');
  });

</script>

setText

function setText(text)

Set the text displayed on the chat bubble.

Parameters

textChat bubble text (string)

Example

<script>

  $zopim(function() {
    $zopim.livechat.bubble.setText('Do you have any question?');
  });

</script>
function show()
Show the chat bubble.
function hide()
Hide the chat bubble.
function reset()
Show the chat bubble.
function setTitle(title)
Set the title displayed on the chat bubble.
function setText(text)
Set the text displayed on the chat bubble.