Webflow sync, pageviews & more.
NEW

How can I make a lightbox video autoplay when opened in Webflow? Additionally, how can I ensure that the navbar element is positioned underneath the lightbox when opened?

TL;DR
  • Add autoplay parameters (?autoplay=1) to YouTube or Vimeo video URLs in the Lightbox video link.
  • Set the Navbar’s z-index to a value lower than 9999 to keep it behind the Lightbox modal.

To make a Lightbox video autoplay and ensure the navbar stays behind the lightbox, you'll need to apply custom settings and minor code adjustments within Webflow.

1. Enable Video Autoplay in Webflow Lightbox

Webflow’s Lightbox doesn’t natively support embedded video autoplay, so you’ll need to host your video on platforms like YouTube or Vimeo and modify the URL.

  • Open the Lightbox component in the Webflow Designer.
  • Select or add a Video Link to your preferred platform (YouTube or Vimeo).
  • Modify the video URL to include autoplay parameters:
  • YouTube: add ?autoplay=1&rel=0 to the URL.
    • Example: https://www.youtube.com/watch?v=VIDEO_ID?autoplay=1&rel=0
  • Vimeo: add ?autoplay=1 to the URL.
    • Example: https://vimeo.com/VIDEO_ID?autoplay=1
  • Important: Make sure the video is not muted, or the browser may block autoplay.
Note: YouTube autoplay may still be blocked by browsers if sound is enabled. Consider muting the video (either by default or via platform settings) to improve success.

2. Position the Navbar Behind the Lightbox

The Webflow Lightbox opens a popup modal that overlays your screen, but sometimes a Navbar with fixed positioning or high z-index can appear above it.

  • Select your Navbar in the Webflow Designer.
  • Go to the Style panel and check the z-index value.
  • Lower the z-index of the Navbar (e.g., set it to 10).
  • The Lightbox modal uses a high z-index (typically 9999), so keep your Navbar’s value lower than that.
  • If the Navbar is using fixed positioning, make sure its z-index is still below the Lightbox modal.

Summary

To autoplay a video in a Webflow Lightbox, append autoplay parameters (?autoplay=1) to the video URL. To ensure the navbar stays behind the lightbox, reduce the Navbar’s z-index to a value below 9999.

Rate this answer

Other Webflow Questions