LogoLogo
WebsiteGuide & TutorialBlogBook a Demo
1.0.0
1.0.0
  • Acquire Developers Hub
  • Acquire
    • Acquire Build Requirement
      • Requirement For Acquire
      • Acquire Speedtest
  • JS API
    • JS Live Chat API
      • Description
      • Installation
      • Visitor
      • Thread
      • Conversation
      • User Verification
    • Quick Link Support
      • One Click Button
      • Social Media Share
    • Backend JS SDK
      • Setup Backend JS SDK
      • Demo Backend SDK
    • Advanced
      • Widget UI
      • Reference
  • Co Browse APIs
    • Acquire Co Browse
      • Co Browse API
  • Acquire API Events
    • WebRTC Related Events
  • iOS
    • SDK Setup Guide
      • Getting Started
      • Integration Guide (Core)
      • Integration Guide (Lite)
      • Manual Setup iOS
      • Acquire Account ID
    • SDK Configuration Example
    • iOS Cobrowse
    • Theme Setting
    • iOS Push Notifications
    • Verify your users
  • Android
    • Getting Started
      • Integration Guide (Core)
      • Integration Guide (Lite)
      • Start using Acquire
    • Acquire APIs
    • Acquire Delegates
    • Custom UI/widget
    • Cross Platform Integrations
  • Webhook API
    • Webhooks Basic
      • Introduction
      • Webhook Integrate Steps
      • Webhook Format
    • Webhook Events
      • On Chat Start
      • On Chat Accept
      • On Chat Message
      • On Chat Close
  • REST APIs
    • OAuth
      • Authorization
      • Tracklog
    • Profiles API
      • Profile List
      • Thread
      • Feedback
      • Profile Details
      • Message
      • Tags
      • Profile Agents
      • Campaigns
      • Profile Add Update
      • Profile Delete
      • Profile Visit History
      • Sender Emails
    • Chat
      • Chat Notes
    • Analytics
      • Chat Statistics
      • Team Analytics
      • Conversion Rate
      • Chat Tag
      • Co browsing
    • Agent
      • Agents List
      • Agent add
      • Edit / Get-agent
      • Update
    • Trigger
      • Triggers List
      • Triggers Detail
    • Operating Hours
      • Save Operating Hours
      • Get Operating Hours
    • Cobrowse
  • Chatbot API
    • Chat Bot
      • Integrate Your Chatbot
      • Dialog Flow V1 Chat-Bot
      • Dialog Flow V2 Chat-Bot
      • Dialog Flow Fulfillment & Custom Response
      • IBM Watson Integration
      • Amazon Lex Bot
      • Azure's QnA Maker
      • Webhook Calling & User Verification
      • Webhook For Reset Password
  • Knowledge Base APIs
    • Help Docs Setup
      • Get FAQ Categories
      • Get Setup Details
      • Get Side List
      • Get Article
      • Get Recent Article
      • Get Categorized Articles
      • Get Suggestion
  • Errors
    • API Error Handling
      • HTTP Responses
Powered by GitBook
On this page
  • Set Vertical Margin
  • Set Horizontal Margin
  • Set Custom z-index
  • Prevent Mobile Scroll
  • Check Widget Status
  • Maximise Widget
  • Minimise Widget
  1. JS API
  2. Advanced

Widget UI

Set Vertical Margin

Set the vertical offset of the chat button from the edge of the browser window.

Parameters

Method

Parameters

Type

Description

setVerticalMargin

distance

Integer

Distance from the edge of the browser window, in pixels (number)

Sample code

Set the widget margin for vertical to 35 pixels for bottom.

<script>
     window.acquire = window.acquire || [];
     acquire.push(function(app){
         var setUIConfogFn = function(){
                    if(app) {
                        app.ui.setVerticalMargin(35);
                    }
                }
         app.on('ui_reloaded', (socket, cr, sr) => {
                    setUIConfogFn();
                });

        setUIConfogFn();
     });
</script>

Set Horizontal Margin

Set the horizontal offset of the chat button from the edge of the browser window.

Parameters

Method

Parameters

Type

Description

setHorizontalMargin

distance

Integer

Distance from the edge of the browser window, in pixels (number)

Sample code

Set the widget margin for horizontal to 35 pixels for left/right

<script>
    window.acquire = window.acquire || [];
     acquire.push(function(app){
         var setUIConfogFn = function(){
                    if(app) {
                        app.ui.setHorizontalMargin(35);
                    }
                }
         app.on('ui_reloaded', (socket, cr, sr) => {
                    setUIConfogFn();
                });

        setUIConfogFn();
     });
</script>

Set Custom z-index

Set the widget custom z-index value

Parameters

Method

Parameters

Type

Description

customZindex

value

number

Sets the stack order of the element. Negative numbers are allowed

Sample Code

Set z-index value for widget element 999.

<script>
    window.acquire = window.acquire || [];
     acquire.push(function(app){
         var setUIConfogFn = function(){
                    if(app) {
                        app.ui.customZindex(999);
                    }
                }
         app.on('ui_reloaded', (socket, cr, sr) => {
                    setUIConfogFn();
                });

        setUIConfogFn();
     });
</script>

Prevent Mobile Scroll

Prevent scroll on mobile devices when widget maximized. default value is true.

Sample Code

<script>
    window.acquire = window.acquire || [];
     acquire.push(function(app){
         var setUIConfogFn = function(){
                    if(app) {
                        app.ui.setMobileTopBodyScrollBlock(false);
                    }
                }
         app.on('ui_reloaded', (socket, cr, sr) => {
                    setUIConfogFn();
                });

        setUIConfogFn();
     });
</script>

Check Widget Status

Widget status is maximize if true.

Sample code

To check widget visible or hidden

<script>
     window.acquire = window.acquire || [];
     acquire.push(function(app){
         var status = app.ui.isMax() ? 'visible' : 'hidden';
     });
</script>

Maximise Widget

Show the chat widget.

Note: It is recommended to show the chat widget only when initial hidden or if any unread message in thread.

Parameters

Method

Parameters

Type

Description

status

value

String

Chat widget status in string 'max'

Sample code

To widget show

<script>
     window.acquire = window.acquire || [];
     acquire.push(function(app){
         app.ui.status('max');
     });
</script>

//on html element onclick
<a href="javascript:;" onclick="acquireIO.ui.status('max');">Open Widget</a>

Minimise Widget

Hide the chat widget and show launcher.

Parameters

Method

Parameters

Type

Description

status

value

String

Chat widget status in string 'min'

Sample code

To widget show

<script>
     window.acquire = window.acquire || [];
     acquire.push(function(app){
         app.ui.status('min');
     });
</script>

//on html element onclick
<a href="javascript:;" onclick="acquireIO.ui.status('min');">Open Widget</a>

PreviousAdvancedNextReference

Last updated 5 years ago