> For the complete documentation index, see [llms.txt](https://developer.tiledesk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.tiledesk.com/widget/tutorials/widget-mobile.md).

# Mobile positioning

In this tutorial we will show to you how to better and simply position Tiledesk Widget on your website when in served on mobile browser Steps to make them is very easy:

1. Copy and paste the basic widget script code
2. Set **mobileMarginX** and **mobileMarginY** property inside window\.tiledeskSettings
3. Use the function window\.Tiledesk(‘show’) to show the widget ONLY if some agent is available.

Here is the full code example

```html
<html>
    <head>
        <script type="application/javascript">
            var PROJECT_ID = "<<TILEDESK_PROJECT_ID>>"
            window.tiledeskSettings=
            {
                projectid: PROJECT_ID,
                startHidden: true,
                mobileMarginX: "20px",
                mobileMarginY: "10px"
            };
            (function(d, s, id) {
                var w=window; var d=document; var i=function(){i.c(arguments);}; 
                i.q=[]; i.c=function(args){i.q.push(args);}; w.Tiledesk=i; 
                var js, fjs=d.getElementsByTagName(s)[0]; 
                if (d.getElementById(id)) return; 
                js=d.createElement(s); 
                js.id=id; js.async=true; js.src="https://widget.tiledesk.com/v6/launch.js";
                fjs.parentNode.insertBefore(js, fjs);
            }(document,'script','tiledesk-jssdk'));

        </script>
    </head>
    <body>
        This Tiledesk example will hide the widget if no agent is available
        <div>
            <b>Agents available:</b> <span id='available'>loading availability...</span>
        </div>
    </body>
</html>
```

Here is in detail what exactly **mobileMarginX** and **mobileMarginY** do

![Mobile positioning](https://user-images.githubusercontent.com/47848430/226629891-bf97c1f5-dd3b-48be-ba70-07a2e5bcdbbf.png)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.tiledesk.com/widget/tutorials/widget-mobile.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
