# Full Screen Header Section - Code Issue WIX Classic

**URL:** <https://forum.wixstudio.com/t/full-screen-header-section-code-issue-wix-classic/75626>\
**Category:** Ask the community\
**Tags:** code\
**Created:** [December 19, 2025, 9:44am UTC](https://forum.wixstudio.com/t/full-screen-header-section-code-issue-wix-classic/75626 "2025-12-19T09:44:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephan\_Cab](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/stephan_cab/32/113961_2.png) [@stephan\_Cab](https://forum.wixstudio.com/u/stephan_Cab)\
**Post date:** [December 19, 2025, 9:44am UTC](https://forum.wixstudio.com/t/full-screen-header-section-code-issue-wix-classic/75626/1 "2025-12-19T09:44:11Z")

</div>

**I’m having trouble with**  
I have a website where I want the header (first section) to automatically adjust to the browser window height, so the background video is displayed at full width and full height.

**Working in**  
WIX Classic, Velo Code

**Site link**

> **[Roxy's Travel Plan | Authentic Asia Tours & Custom Getaways](https://www.roxystravelplan.com/)**
>
> Explore authentic and ethical travel experiences across Asia with Roxy's Travel Plan. Handcrafted tours and custom itineraries personally tested over 2+ years of real-world travel. Discover meaningful journeys tailored to your style. we offer service...

**What I’ve tried so far**  
I initially tried using various elements, but it seems that in Wix, you can only adjust a strip’s width using the “stretched” option, adjusting the height isn’t supported.

Next, I experimented with multiple Velo code solutions:

My first approach was to place the video as the background of a strip and use Dev Mode code to make the strip’s height adjust dynamically based on the window size. Here’s an example of one of the codes I tried (I explored several variations, but none worked as expected):

```javascript
import wixWindow from 'wix-window';

let isAdjusting = false;

$w.onReady(function () {
  // Initial adjustment
  adjustStripHeight();
  
  // Adjust on window resize with debouncing
  wixWindow.onResize(() => {
    if (!isAdjusting) {
      isAdjusting = true;
      setTimeout(() => {
        adjustStripHeight();
        isAdjusting = false;
      }, 150);
    }
  });
});

function adjustStripHeight() {
  try {
    const videoStrip = $w('#VideoHeaderStrip');
    
    // Get viewport height
    const viewportHeight = wixWindow.viewportSize.height;
    
    // Full screen height (100vh)
    videoStrip.height = viewportHeight;
    
    console.log(`Strip height set to: ${viewportHeight}px`);
    
  } catch(error) {
    console.error('Error adjusting strip height:', error);
  }
}

```

The second approach I tried was to adjust the **section height** instead of the strip. I removed the strip, placed the video as the background of the header section, and used Velo code to dynamically resize the section (Several code tentative too…). However, this method was also unsuccessful.

```javascript
import wixWindow from 'wix-window';

$w.onReady(() => {
  setSectionHeight();
  wixWindow.onResize(setSectionHeight);
});

function setSectionHeight() {
  const vh = wixWindow.viewportSize.height;
  $w('#section7').height = vh;
}

```

Another version here:

```javascript
import wixWindow from 'wix-window';
// ... 
wixWindow.getBoundingRect()
.then( (windowSizeInfo) => {
    let windowHeight = windowSizeInfo.window.height;
    // 565
    let windowWidth = windowSizeInfo.window.width;
    // 1269
    let documentHeight = windowSizeInfo.document.height;
    // 780
    let documentWidth = windowSizeInfo.document.width;
    // 1269
    let scrollX = windowSizeInfo.scroll.x;
    // 0
    let scrollY = windowSizeInfo.scroll.y;
    // 120
} );

$w.onReady(function () {
  forceHeaderHeight();
  
  wixWindow.onResize(() => {
    forceHeaderHeight();
  });
});

function forceHeaderHeight() {
  const vh = wixWindow.viewportSize.height;
  
  // Get ALL elements in first section and force height
  const sections = $w('Section');
  if (sections.length > 0) {
    const header = sections[0];
    
    // Force section
    header.height = vh;
    
    // Force EVERY element inside
    try {
      header.$w('*').forEach(element => {
        if (element.height !== undefined) {
          element.height = vh;
        }
      });
    } catch(e) {}
    
    console.log(`Forced all heights to: ${vh}px`);
  }
}

```

**Outcome**  
So far, I’ve spent several days trying to create a video header that automatically adjusts to different screen sizes, but I haven’t had any success. I’m beginning to doubt whether this is possible in Wix Classic. I’m hoping to connect with a Wix expert here who can help, I would really appreciate it. I look forward to your thoughts and feedback.

Thank you so much in advance!
