> For the complete documentation index, see [llms.txt](https://en.docs.airdesk.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://en.docs.airdesk.ai/interface/administracao/espaco/opcoes-adicionais-do-widget.md).

# Additional Widget Options

Within the code generated by Airdesk, you can add extra widget handling options. &#x20;

Example of a code generated by Airdesk that is placed on the client's page:

```markup
 <script defer> 

      (function (a, i, r, d, e, s, k) { 

        a.airdesk = { settings: { cpid: "TEST-EXAMPLE" } }; 

        e = i.getElementsByTagName("head")[0]; 

        s = i.createElement("script"); 

        s.async = 1; 

        s.src = r + d; 

        e.appendChild(s); 

        a.$airdeskOnLoad = () => { 

          var {$airdesk} = a;

//Extra options are added below this line 

}; 

      })(window, document, "https://script.airdesk.ai/v1/", "air.js"); 

    </script> 
```

| Option                    | Explanation                                                                                                                                                                                                                                        |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| $airdesk.open()           | The widget will open the form automatically as soon as it's ready.                                                                                                                                                                                 |
| $airdesk.close()          | The widget closes the form.                                                                                                                                                                                                                        |
| $airdesk.language(CODE)   | <p>If the user doesn't have a language already saved.  <br>This option allows you to choose a starting language, instead of choosing the starting language depending on the browser's language.  Examples of CODE "en-GB", "pt-PT", "en-ES".  </p> |
| $airdesk.position(STRING) | Changes the initial positioning to a pre-effect.                                                                                                                                                                                                   |
| $airdesk.position('bl')   | Changes the widget's positioning to the lower left corner.                                                                                                                                                                                         |
| $airdesk.right(NUMBER)    | Replaces the initial positioning of the widget button on the right. The positioning is done on px basis.                                                                                                                                           |
| $airdesk.left(NUMBER)     | Replaces the initial positioning of the widget button on the left. The positioning is done on px basis.                                                                                                                                            |
| $airdesk.bottom(NUMBER)   | Replaces the initial positioning of the widget button vertically starting from below. The positioning is done on a px basis.                                                                                                                       |
| $airdesk.top(NUMBER)      | Replaces the initial positioning of the widget button vertically starting at the top. The positioning is done on a px basis.                                                                                                                       |
| $airdesk.hidden()         | Hide the page widget. It no longer allows to press the button and open the form.                                                                                                                                                                   |
| $airdesk.visible()        | Shows the widget that has been hidden.                                                                                                                                                                                                             |

{% hint style="info" %}
To use widget functions with javascript, these must always be called within a load event.&#x20;

window\.addEventListener ('load', function () {})
{% endhint %}

You can call up these options after initialization of the widget like for example make the widget, after loading on the page, automatically open the form as follows:&#x20;

```markup
 <script defer> 

      (function (a, i, r, d, e, s, k) { 

        a.airdesk = { settings: { cpid: "TEST-EXAMPLE" } }; 

        e = i.getElementsByTagName("head")[0]; 

        s = i.createElement("script"); 

        s.async = 1; 

        s.src = r + d; 

        e.appendChild(s); 

        a.$airdeskOnLoad = () => { 

          var {$airdesk} = a;

//Opções extra são adicionadas abaixo desta linha 

$airdesk.open() 

}; 

      })(window, document, "https://script.airdesk.ai/v1/", "air.js"); 

    </script> 
```

Or, it's also possible to call the options in the client's javascript after the widget is initialized, as follows:&#x20;

```markup
window.$airdesk.open(); 
```
