Menu

Embedding a 360 virtual tour on any website: iframe vs. script, sizing and the gotchas
📰

Embedding a 360 virtual tour on any website: iframe vs. script, sizing and the gotchas

DEV Community: html·Prewalk·about 2 hours ago
#4se2u4Nl
#devto2#devto#dev#iframe#embed
Reading 0:00
15s threshold

Real estate and architecture sites increasingly put a walkable 360° tour right on the listing page instead of linking out. Under the hood it's just an iframe, but there are a few decisions that decide whether it feels native or broken. This is what we've learned building embeds for Prewalk , a browser-based 360° tour tool, but most of it applies to any panorama viewer.

1. Two ways to embed: iframe + script, or iframe only

Iframe + a small script (the nicer option)

The script listens for messages from the viewer and resizes the iframe to fit the content, so you don't hard-code a height.

It can also hand off to real full screen on your own page, which matters a lot on phones.

Iframe only, fixed height (the fallback)

Use it when the site builder strips <script> tags (Wix, Google Sites and many CMS text fields do).

You choose the height yourself.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.