# Left Navigation Bar with button to expand, collapse to enable more Content space

**URL:** <https://forum.wixstudio.com/t/left-navigation-bar-with-button-to-expand-collapse-to-enable-more-content-space/78427>\
**Category:** Ask the community\
**Tags:** question, wix-studio, code\
**Created:** [June 3, 2026, 9:53pm UTC](https://forum.wixstudio.com/t/left-navigation-bar-with-button-to-expand-collapse-to-enable-more-content-space/78427 "2026-06-03T21:53:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin\_Drath](https://avatars.discourse-cdn.com/v4/letter/k/41988e/32.png) [@Kevin\_Drath](https://forum.wixstudio.com/u/Kevin_Drath)\
**Post date:** [June 3, 2026, 9:53pm UTC](https://forum.wixstudio.com/t/left-navigation-bar-with-button-to-expand-collapse-to-enable-more-content-space/78427/1 "2026-06-03T21:53:08Z")

</div>

**I’m having trouble with**  
Creating a button to collapse the left nav bar. After adding code to button, and rendering in Test Site, the left nav bar shifts right, the button does not move, the content does not fill the new space.

**Working in**  
Wix Studio Editor Dev Mode

**What I’m trying to do**  
See Image below

**What I’ve tried so far**  
AI Code Generator, each iteration, but things it has me try it says are not available in Wix Studio, so wasted effort.

 ![Left Nav Bar](https://us1.discourse-cdn.com/wix/original/3X/1/1/1130686dead3d0a8fbb3cffe5c86916df3e57a53.png)

---

<div class="post-metadata">

**Author:** ![Dan\_Suhr](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/dan_suhr/32/94074_2.png) [@Dan\_Suhr](https://forum.wixstudio.com/u/Dan_Suhr)\
**Post date:** [June 4, 2026, 1:25am UTC](https://forum.wixstudio.com/t/left-navigation-bar-with-button-to-expand-collapse-to-enable-more-content-space/78427/2 "2026-06-04T01:25:57Z")

</div>

I played around with this a while back for a similar set up. When editor X shut down and you could no longer pin a section to the side.

Its a bit of a work around as I had to double up the right hand content and just used show/hide code.

Maybe there is a better way to do now, but havnt had any jobs that require it to test more.

test site

> **[Home | side menubar](https://dcidesigns.wixstudio.com/my-site-9)**

 ![Screenshot 2026-06-04 112347](https://us1.discourse-cdn.com/wix/original/3X/f/e/fe3f31c30c679607ae39255b338dada9551eee22.jpeg)

```javascript
export function vectorImage5_click(event) {
    $w('#box2').show();
    $w('#box5').hide();
    $w('#text4').hide();
    $w('#text5').show();

}

```

```javascript
export function vectorImage1_click(event) {
    $w('#box2').hide();
    $w('#box5').show();
    $w('#text5').hide();
    $w('#text4').show();
}

```
