Extra settings for Callback

Once you set up the Callback widget on your web page, you also can expand its configurations.

Here’s what you can do:

  1. Turn off the Callback basic and auto form on the required page of your site.
  2. Attach the Callback widget to your buttons on the web page.
Turning off the widget on some pages of your web site

You can disable the widget on some pages of the site you don’t need it. For example, that’s the pages for the free vacancies in your company. As your client won’t need this web page, there’s no need to connect them to the agents via Callback widget.

  1. To disable the widget on the required page and the next ones.
  2. <script>
    function disableCallback(){
    if (typeof(ringostatAPI) !== 'undefined') {
    ringostatAPI.setCallbackSettings({CallbackOff:true});
    } else {
    setTimeout(disableCallback,200);
    }
    }
    disableCallback();
    </script>
    	
  3. Disabling the widget on a current web page
  4. <script>
    function disableCallback(){
    if (typeof(ringostatAPI) !== 'undefined') {
    ringostatAPI.setCallbackSettings({CallbackOffOnPage:true});
    } else {
    setTimeout(disableCallback,200);
    }
    }
    disableCallback();
    </script>
    	
  5. Disabling the widget on the web pages which begins with some phrase/word. For example, ‘compare’.
  6. <script>
    $(function(){
    if (location.href.indexOf('compare') > -1) {
    ringostatAPI.setCallbackSettings({CallbackOffOnPage:true});
    }
    });
    </script>
    	
  7. Turning off the auto form on the required page and the next ones
  8. <script>
    function disableCallback(){
    if (typeof(ringostatAPI) !== 'undefined') {
    ringostatAPI.setCallbackSettings({autoFormOff:true});
    } else {
    setTimeout(disableCallback,200);
    }
    }
    disableCallback();
    </script>
    	
  9. Turning off the auto form on the current web page
  10. <script>
    function disableCallback(){
    if (typeof(ringostatAPI) !== 'undefined') {
    ringostatAPI.setCallbackSettings({autoFormOffOnPage:true});
    } else {
    setTimeout(disableCallback,200);
    }
    }
    disableCallback();
    </script>
    	
Attaching your buttons to the Callback widget

Let’s see how it works for the most popular cases: for links and buttons:

//Example for a link
<a href="#"> ☎ Call me </a>
//Example for a button
<button> ☎ Call me </button>
  1. First of all, you should tag the element you want to attach to the Callback widget the class “callback-ringo”.
  2. //Example for a link
    <a class="callback-ringo" href="#"> ☎ Call me </a>
    //Example for a button
    <button class="callback-ringo"> ☎ Call me </button>
    	
  3. Then put the following script in the code of your web page, so the link or button will be attached to the Callback widget from your project.
  4. <script type="text/javascript">
    var rngstcbev = function(){
    var classname = document.getElementsByClassName("callback-ringo");
    var myFunction = function() {
    document.getElementsByClassName('rngst_phone_icon')[0].dispatchEvent(new Event("mousedown",{bubbles: true, cancelable: false}));
    };
    for (var i = 0; i < classname.length; i++) {
    if(typeof classname[i] !== 'undefined') {
    classname[i]. {
    event = event || window.event;
    if (event.preventDefault) {
    event.preventDefault();
    } else {
    event.returnValue = false;
    }
    myFunction();
    }
    }
    }
    };
    document.addEventListener("DOMContentLoaded", rngstcbev);
    </script>
    	
Is article helpful?