0.0.7 • Published 7 years ago
call1800 v0.0.7
call1800 is an embeddable element that allows your users make calls to 1800 numbers completely free.
Installation
via NPM (recommended)
npm install call1800via CDN
<link rel="stylesheet" href="<ADD_LINK_HERE>">
<script src="<ADD_LINK_HERE>"></script>Usage
Quick start
Add
dist/main.cssto your styles.Initialize dialpad with Javascript.
import Dialpad from 'call1800'; // if you used CDN Dialpad class is available at window.Dialpad
const dialpad = new Dialpad();
dialpad.render();Available methods
new Dialpad(options)
Creates dialpad instance with options object. You can omit options if defaults
values are suitable for your use case.
Available options:
| Option | Description | Default value | Data type |
|---|---|---|---|
| closed | Changes initial state of the dialpad. If true - dialpad will be collapsed by default | false | Boolean |
Example:
const dialpad = new Dialpad({
closed: true,
});dialpad.render()
Renders dialpad on page.
dialpad.call(number)
Starts a call to number. number must be a String that starts with 18xx and
exactly 11 characters long.
dialpad.hangUp()
Stops active call.
dialpad.toggle()
Collapse or open dialpad.
dialpad.open()
Opens dialpad.
dialpad.close()
Collapses dialpad.