nsc_Visitor.open()

Allows for opening the chat widget in software.

Examples

  1. Automatic opening of the chat widget upon going online

    Widget slides out or appears as the status changes to online

    nsc_API = {
        onOnline: function(data) {
            // Automatic opening of the chat widget upon going online
            if (data.real) nsc_Visitor.open();
        }
    };
  2. Widget opening when a button or a link on the page is clicked

    For instance the page contains a "Live Chat" link like this:

    <a href="#">Live Chat</a>

    Add the onclick attribute containing the widget opening code to this link like this:

    <a href="#" onclick="(typeof nsc_Visitor != 'undefined')&&nsc_Visitor.open(); return false;">Live Chat</a>
    Three actions are performed in this case:
    1. nsc_Visitor object existance check
    2. Widget opening
    3. Prevention of default click action, which is the URL following in anchor tag case

See also

  • .close() - Close/minimize the widget
  • .onOpen() - Event for handling the widget opening and preventing it if neccessary.
  • .onAfterOpen() - Event triggered when all anumations of widget opening are completed

All rights reserved. Copyright © 2017 Netrox SC
Host CMS