Issue symptoms
After adding the Web Widget (Classic) to my website, I notice that the widget covers other buttons on the page.
Resolution steps
Use our API codes to move the widget either vertically or horizontally or both. This is what we call offsetting the button and window from the edge of the browser window or mobile app window. This article will cover how to offset your widget button and widget window from the default position.
Vertical offset
This API code sets the vertical offset of the chat button from the edge of the browser window:
<script type="text/javascript">
$zopim(function() {
$zopim.livechat.button.setOffsetVertical(50);
});
</script>
Change the number inside ()
depending on your needs.
The default position of the chat button is on the bottom-right corner of the page. Applying the vertical offset code results in the button moving vertically towards the top of the page.
This API code will vertically offset the chat window together with the chat button:
$zopim.livechat.window.setOffsetVertical(50);
Change the number inside()
depending on your needs.
The default position of the chat window opens from the bottom of the page. After applying the API code, your chat window will now open a specified distance from the bottom of the page.
Horizontal offset
Use this API code to set the horizontal offset of the chat button from the edge of the browser window:
<script type="text/javascript">
$zopim(function() {
$zopim.livechat.button.setOffsetHorizontal(50);
});
</script>
Change the number inside()
depending on your needs.
Applying the horizontal offset button code results in the button moving horizontally towards the left side of the page.
This API code will horizontally offset the chat window:
$zopim.livechat.window.setOffsetHorizontal(50);
Change the number inside()
depending on your needs.
Applying the horizontal offset window code results in the window moving horizontally towards the left side of the page:
Mobile offset
Offset for the mobile chat button and window using the API codes below:
<script type="text/javascript">
$zopim(function() {
$zopim.livechat.button.setOffsetVerticalMobile(30);
$zopim.livechat.window.setOffsetVerticalMobile(30);
$zopim.livechat.button.setOffsetHorizontalMobile(30);
$zopim.livechat.window.setOffsetHorizontalMobile(30);
});
</script>
Change the number inside ()
depending on your needs.
For more information, see this article: Javascript API.