# Hide tabs on mobile device

**URL:** https://discourse.nodered.org/t/hide-tabs-on-mobile-device/41467
**Category:** Dashboard
**Created:** [23 February 2021 09:50 UTC](https://discourse.nodered.org/t/hide-tabs-on-mobile-device/41467 "2021-02-23T09:50:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![sfedo](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@sfedo](https://discourse.nodered.org/u/sfedo)
#### Post date: [23 February 2021 09:50 UTC](https://discourse.nodered.org/t/hide-tabs-on-mobile-device/41467/1 "2021-02-23T09:50:07Z")

</div>

Hello,

I would like to build 2 different tabs for each device: 1 tab for mobile device and another for common desctop pc.

I have this function added to my head section:

```auto
<script>
function myFunction(x) {
 if (x.matches) { // If media query matches
   window.location.replace("http://ip-address/ui/#!/4");
}else{
   window.location.replace("http://ip-address/ui/#!/0")
}
}

var x = window.matchMedia("(max-width: 700px)")
myFunction(x) // Call listener function at run time
x.addListener(myFunction) // Attach listener function on state changes
</script>

```

and it works very well and I get relocated properly, but now I want to hide from menu the tab 0 when using mobile device and also hide tab 4 when using desctop.

Does it work with ui\_control??

Someone any idea?

---

<div class="post-metadata">

### Author: ![sfedo](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@sfedo](https://discourse.nodered.org/u/sfedo)
#### Post date: [23 February 2021 13:12 UTC](https://discourse.nodered.org/t/hide-tabs-on-mobile-device/41467/2 "2021-02-23T13:12:17Z")

</div>

Update:

Ok I found the way to hide tabs with ui\_control. But I still need some msg to return from function above.  
How to add a return payload to this function?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [25 March 2021 13:12 UTC](https://discourse.nodered.org/t/hide-tabs-on-mobile-device/41467/3 "2021-03-25T13:12:45Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
